Skip to contentSkip to conversation

xfstests 249: use -F option for xfs_io

PATCH Superseded Eric Sandeen 3 participants 4 messages Mar 23, 2011 – Apr 4, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests 249: use -F option for xfs_io

Test 249 was appearing to pass on ext4, but it wasn't really exercising the test due to lack of "-F" in the xfs_io arguments.

Without -F the files were created (oddly enough); neither pwrite nor sendfile were executed, and the diff of the two (empty) files passed, resulting in a passed test without testing anything.

So add the -F, capture the output, and test the result of each xfs_io invocation.

---

249 +5 -2
index 6fc972e..3b3a64d
@@ -52,9 +52,12 @@ echo "Feel the serenity."
 
 SRC=$TEST_DIR/$seq.src
 DST=$TEST_DIR/$seq.dst
+rm -f $seq.full
 
-$XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC > /dev/null 2>&1
-$XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST > /dev/null 2>&1
+$XFS_IO_PROG -F -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seq.full 2>&1
+[ $? -ne 0 ] && _fail "xfs_io pwrite failed"
+$XFS_IO_PROG -F -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seq.full 2>&1
+[ $? -ne 0 ] && _fail "xfs_io sendfile failed"
 
 diff $SRC $DST
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH v2 1/1 xfstests 249: use -F option for xfs_io

Test 249 was appearing to pass on ext4, but it wasn't really exercising the test due to lack of "-F" in the xfs_io arguments.

Without -F the files were created (oddly enough); neither pwrite nor sendfile were executed, and the diff of the two (empty) files passed, resulting in a passed test without testing anything.

So add the -F, capture the output, and test the result of each xfs_io invocation.

Also, when it fails, the diff output is huge. Make diff silent, but describe the diff failure and exit.

---

V2: change diff to diff -q

249 +8 -4
old mode 100644
new mode 100755
index 6fc972e..100cd4c
@@ -52,11 +52,15 @@ echo "Feel the serenity."
 
 SRC=$TEST_DIR/$seq.src
 DST=$TEST_DIR/$seq.dst
+rm -f $seq.full
 
-$XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC > /dev/null 2>&1
-$XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST > /dev/null 2>&1
-
-diff $SRC $DST
+$XFS_IO_PROG -F -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seq.full 2>&1
+[ $? -ne 0 ] && _fail "xfs_io pwrite failed"
+$XFS_IO_PROG -F -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seq.full 2>&1
+[ $? -ne 0 ] && _fail "xfs_io sendfile failed"
 
+diff -q $SRC $DST
 status=$?
+[ $status -ne 0 ] && _fail "$SRC and $DST differ"
+
 exit

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v2 1/1
#2 lore raw
Quoted 9 lines · Eric Sandeen

Test 249 was appearing to pass on ext4, but it wasn't really exercising the test due to lack of "-F" in the xfs_io arguments.

Without -F the files were created (oddly enough); neither pwrite nor sendfile were executed, and the diff of the two (empty) files passed, resulting in a passed test without testing anything.

So add the -F, capture the output, and test the result of each xfs_io invocation.

Ok.

Quoted 2 lines

Also, when it fails, the diff output is huge. Make diff silent, but describe the diff failure and exit.

Excellent - I was going to suggest this myself given you were touching this test.

Quoted 1 line
Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v2 1/1
#3 lore raw
In reply to Eric Sandeen
Quoted 7 lines · Eric Sandeen

Test 249 was appearing to pass on ext4, but it wasn't really exercising the test due to lack of "-F" in the xfs_io arguments.

Without -F the files were created (oddly enough); neither pwrite nor sendfile were executed, and the diff of the two (empty) files passed, resulting in a passed test without testing anything.

Quoted 7 lines

So add the -F, capture the output, and test the result of each xfs_io invocation.

Also, when it fails, the diff output is huge. Make diff silent, but describe the diff failure and exit.

Looks good.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs