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