1 FSCK_OPT=-fn 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 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 13 14 gzip -d < $test_dir/image.gz > $TMPFILE 15 16 old="$($CRCSUM < $TMPFILE)" 17 18 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 19 status=$? 20 echo Exit status is $status >> $OUT.new 21 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT 22 rm -f $OUT.new 23 24 new="$($CRCSUM < $TMPFILE)" 25 26 if [ "${old}" != "${new}" ]; then 27 echo "ERROR: crc mismatch! ${old} ${new}" >> $OUT 28 else 29 echo "crc did not change. ${old}" >> $OUT 30 fi 31 32 rm -f $TMPFILE 33 34 cmp -s $OUT $EXP 35 status=$? 36 37 if [ "$status" = 0 ] ; then 38 echo "$test_name: $test_description: ok" 39 touch $test_name.ok 40 else 41 echo "$test_name: $test_description: failed" 42 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 43 rm -f $test_name.tmp 44 fi 45 46 unset IMAGE FSCK_OPT OUT EXP old new 47