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$E2MMPSTATUS $TMPFILE > $OUT 2>&1 16echo Exit status is $? >> $OUT 17$FSCK -fy $TMPFILE >> $OUT 2>&1 18echo Exit status is $? >> $OUT 19$E2MMPSTATUS $TMPFILE >> $OUT 2>&1 20echo Exit status is $? >> $OUT 21$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1 22sed -f $cmd_dir/filter.sed $OUT > $OUT.new 23mv $OUT.new $OUT 24 25rm -f $TMPFILE 26cmp -s $OUT $EXP 27status=$? 28 29if [ "$status" = 0 ] ; then 30 echo "$test_name: $test_description: ok" 31 touch $test_name.ok 32else 33 echo "$test_name: $test_description: failed" 34 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 35 rm -f $test_name.tmp 36fi 37unset OUT EXP 38