2014-08-03 07:49:41 +04:00
|
|
|
# use current directory instead of /tmp becase tmpfs doesn't support DIO
|
|
|
|
rm -f $TMPFILE
|
|
|
|
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
|
|
|
|
|
|
|
|
stat -f $TMPFILE | grep -q "Type: tmpfs"
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
rm -f $TMPFILE
|
|
|
|
echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
gzip -dc < $test_dir/image.gz > $TMPFILE
|
|
|
|
|
2014-11-08 00:50:49 +03:00
|
|
|
OUT=$test_name.log
|
2014-08-03 07:49:41 +04:00
|
|
|
EXP=$test_dir/expect
|
|
|
|
$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT
|
|
|
|
echo Exit status is $? >> $OUT
|
|
|
|
|
|
|
|
rm -f $TMPFILE
|
|
|
|
cmp -s $OUT $EXP
|
|
|
|
status=$?
|
|
|
|
|
|
|
|
if [ "$status" = 0 ] ; then
|
|
|
|
echo "$test_name: $test_description: ok"
|
|
|
|
touch $test_name.ok
|
|
|
|
else
|
|
|
|
echo "$test_name: $test_description: failed"
|
|
|
|
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
|
|
|
|
rm -f $test_name.tmp
|
|
|
|
fi
|
|
|
|
unset OUT EXP
|