1# use current directory instead of /tmp becase tmpfs doesn't support DIO 2rm -f $TMPFILE 3TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX) 4 5stat -f $TMPFILE | grep -q "Type: tmpfs" 6if [ $? = 0 ]; then 7 rm -f $TMPFILE 8 echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)" 9 return 0 10fi 11gzip -dc < $test_dir/image.gz > $TMPFILE 12 13OUT=$test_name.log 14EXP=$test_dir/expect 15$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT 16echo Exit status is $? >> $OUT 17 18rm -f $TMPFILE 19cmp -s $OUT $EXP 20status=$? 21 22if [ "$status" = 0 ] ; then 23 echo "$test_name: $test_description: ok" 24 touch $test_name.ok 25else 26 echo "$test_name: $test_description: failed" 27 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 28 rm -f $test_name.tmp 29fi 30unset OUT EXP 31