File: script

package info (click to toggle)
e2fsprogs 1.43.1-1
  • links: PTS
  • area: main
  • in suites: jessie-backports
  • size: 31,916 kB
  • sloc: ansic: 119,879; sh: 5,789; makefile: 5,460; awk: 523; yacc: 288; sed: 207; perl: 170; python: 23
file content (44 lines) | stat: -rw-r--r-- 1,103 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash

if [ "$(grep -c 'define HAVE_MAGIC_H' ../lib/config.h)" -gt 0 ]; then

FSCK_OPT=-fn
IMAGE=$test_dir/image.bz2

bzip2 -d < $IMAGE > $TMPFILE
dd if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1

# Run fsck to fix things?
if [ -x $DEBUGFS_EXE ]; then
	EXP=$test_dir/expect
else
	EXP=$test_dir/expect.nodebugfs
fi
OUT=$test_name.log
rm -rf $test_name.failed $test_name.ok

echo "*** e2fsck" > $OUT
$FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1
echo "*** debugfs" >> $OUT
test -x $DEBUGFS_EXE && $DEBUGFS_EXE -R 'quit' $TMPFILE >> $OUT 2>&1
echo "*** tune2fs" >> $OUT
$TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1
echo "*** mke2fs" >> $OUT
$MKE2FS -n $TMPFILE >> $OUT 2>&1

sed -f $cmd_dir/filter.sed -e "s|$TMPFILE|test.img|g" < $OUT > $OUT.new
mv $OUT.new $OUT

# Figure out what happened
if cmp -s $EXP $OUT; then
	echo "$test_name: $test_description: ok"
	touch $test_name.ok
else
	echo "$test_name: $test_description: failed"
	diff -u $EXP $OUT >> $test_name.failed
fi
unset EXP OUT FSCK_OPT IMAGE

else #if HAVE_MAGIC_H
	echo "$test_name: $test_description: skipped"
fi