public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests 249: use -F option for xfs_io
@ 2011-03-23 15:53 Eric Sandeen
  2011-03-23 16:03 ` [PATCH V2] " Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2011-03-23 15:53 UTC (permalink / raw)
  To: xfs-oss

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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/249 b/249
index 6fc972e..3b3a64d
--- a/249
+++ b/249
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V2] xfstests 249: use -F option for xfs_io
  2011-03-23 15:53 [PATCH] xfstests 249: use -F option for xfs_io Eric Sandeen
@ 2011-03-23 16:03 ` Eric Sandeen
  2011-03-23 22:50   ` Dave Chinner
  2011-04-04 18:36   ` Alex Elder
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sandeen @ 2011-03-23 16:03 UTC (permalink / raw)
  To: xfs-oss

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 <sandeen@redhat.com>
---

V2: change diff to diff -q

diff --git a/249 b/249
old mode 100644
new mode 100755
index 6fc972e..100cd4c
--- 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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] xfstests 249: use -F option for xfs_io
  2011-03-23 16:03 ` [PATCH V2] " Eric Sandeen
@ 2011-03-23 22:50   ` Dave Chinner
  2011-04-04 18:36   ` Alex Elder
  1 sibling, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2011-03-23 22:50 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Wed, Mar 23, 2011 at 11:03:32AM -0500, Eric Sandeen wrote:
> 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.

> 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.

> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] xfstests 249: use -F option for xfs_io
  2011-03-23 16:03 ` [PATCH V2] " Eric Sandeen
  2011-03-23 22:50   ` Dave Chinner
@ 2011-04-04 18:36   ` Alex Elder
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Elder @ 2011-04-04 18:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Wed, 2011-03-23 at 11:03 -0500, Eric Sandeen wrote:
> 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 <sandeen@redhat.com>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-04 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-23 15:53 [PATCH] xfstests 249: use -F option for xfs_io Eric Sandeen
2011-03-23 16:03 ` [PATCH V2] " Eric Sandeen
2011-03-23 22:50   ` Dave Chinner
2011-04-04 18:36   ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox