1 #!/bin/bash 2 3 FSCK_OPT=-fn 4 IMAGE=$test_dir/image.bz2 5 6 bzip2 -d < $IMAGE > $TMPFILE 7 8 # Run fsck to fix things? 9 if [ -x $DEBUGFS_EXE ]; then 10 EXP=$test_dir/expect 11 else 12 EXP=$test_dir/expect.nodebugfs 13 fi 14 OUT=$test_name.log 15 rm -f $test_name.failed $test_name.ok 16 17 echo "*** e2fsck" > $OUT 18 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 19 echo "*** debugfs" >> $OUT 20 test -x $DEBUGFS_EXE && $DEBUGFS -R 'quit' $TMPFILE >> $OUT 2>&1 21 echo "*** tune2fs" >> $OUT 22 $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 23 echo "*** mke2fs" >> $OUT 24 $MKE2FS -n -b 1024 $TMPFILE >> $OUT 2>&1 25 26 sed -f $cmd_dir/filter.sed < $OUT > $OUT.new 27 mv $OUT.new $OUT 28 29 # Figure out what happened 30 if cmp -s $EXP $OUT; then 31 echo "$test_name: $test_description: ok" 32 touch $test_name.ok 33 else 34 echo "$test_name: $test_description: failed" 35 diff -u $EXP $OUT >> $test_name.failed 36 fi 37 unset EXP OUT FSCK_OPT IMAGE 38