3 if [ "$(grep -c 'define HAVE_MAGIC_H' $test_dir/../../lib/config.h)" -gt 0 ]; then
6 IMAGE=$test_dir/image.bz2
8 bzip2 -d < $IMAGE > $TMPFILE
9 dd if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1
11 # Run fsck to fix things?
12 if [ -x $DEBUGFS_EXE ]; then
15 EXP=$test_dir/expect.nodebugfs
18 rm -rf $test_name.failed $test_name.ok
20 echo "*** e2fsck" > $OUT
21 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1
22 echo "*** debugfs" >> $OUT
23 test -x $DEBUGFS_EXE && $DEBUGFS_EXE -R 'quit' $TMPFILE >> $OUT 2>&1
24 echo "*** tune2fs" >> $OUT
25 $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1
26 echo "*** mke2fs" >> $OUT
27 $MKE2FS -n $TMPFILE >> $OUT 2>&1
29 sed -f $cmd_dir/filter.sed -e "s|$TMPFILE|test.img|g" -i $OUT
31 # Figure out what happened
32 if cmp -s $EXP $OUT; then
33 echo "$test_name: $test_description: ok"
36 echo "$test_name: $test_description: failed"
37 diff -u $EXP $OUT >> $test_name.failed
39 unset EXP OUT FSCK_OPT IMAGE
42 echo "$test_name: $test_description: skipped"