1 FSCK_OPT=-fy 2 OUT=$test_name.log 3 if [ -f $test_dir/expect.gz ]; then 4 EXP=$test_name.tmp 5 gunzip < $test_dir/expect.gz > $EXP1 6 else 7 EXP=$test_dir/expect 8 fi 9 10 cp /dev/null $OUT 11 12 bzip2 -dc < $test_dir/image.tar.bz2 | tar xf - 13 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img "$JOURNAL_DUMP_DIR/$test_name.img" 14 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img.jnl "$JOURNAL_DUMP_DIR/$test_name.img.jnl" 15 16 $FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img > $OUT.new 2>&1 17 status=$? 18 echo Exit status is $status >> $OUT.new 19 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT 20 rm -f $OUT.new 21 22 $FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img > $OUT.new 2>&1 23 status=$? 24 echo Exit status is $status >> $OUT.new 25 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT 26 rm -f $OUT.new 27 28 rm -f $TMPFILE $test_name.img $test_name.img.jnl 29 30 cmp -s $OUT $EXP 31 status=$? 32 33 if [ "$status" = 0 ] ; then 34 echo "$test_name: $test_description: ok" 35 touch $test_name.ok 36 else 37 echo "$test_name: $test_description: failed" 38 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 39 rm -f $test_name.tmp 40 fi 41 42 unset IMAGE FSCK_OPT OUT EXP 43