From 4342e767089ffda9924e0011695363b8d1f98c49 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 4 Apr 2011 13:46:10 -0500 Subject: [PATCH] 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. Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner --- 249 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 249 diff --git a/249 b/249 old mode 100644 new mode 100755 index 6fc972e9..100cd4cb --- a/249 +++ b/249 @@ -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 -- 2.30.2