Whamcloud - gitweb
libext2fs: don't use O_DIRECT for files on tmpfs
[tools/e2fsprogs.git] / tests / f_mmp / script
index 9ff16c9..f433bd5 100644 (file)
@@ -1,16 +1,5 @@
 FSCK_OPT=-yf
 
-# 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
-
 echo "make the test image ..." > $test_name.log
 $MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1
 status=$?
@@ -43,6 +32,13 @@ rm -f $MARKFILE
 echo "kill debugfs abruptly (simulates e2fsck failure) ..." >> $test_name.log
 kill_debugfs
 
+$E2MMPSTATUS $TMPFILE > $test_name.log 2>&1
+status=$?
+if [ "$status" != 1 ] ; then
+       echo "$E2MMPSTATUS with EXT2_MMP_SEQ_FSCK passed!" > $test_name.failed
+       echo "$test_name: $test_description: failed"
+       return 1
+fi
 
 echo "e2fsck (should fail mmp_seq = EXT2_MMP_SEQ_FSCK) ..." >> $test_name.log
 $FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1