linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: make test btrfs/025 more robust
@ 2014-01-28 14:46 Filipe David Borba Manana
  2014-01-28 14:51 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Filipe David Borba Manana @ 2014-01-28 14:46 UTC (permalink / raw)
  To: xfs; +Cc: linux-btrfs, jbacik, Filipe David Borba Manana

Make the test btrfs/025 not depend on the output of the btrfs tools
subvolume, send, receive and filesystem commands output. The output
of these commands has changed several times in the past, and it can
change again in the future. Therefore just test for failure/success
and not for the exact output on the success case.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---
 tests/btrfs/025     |   34 +++++++++++++++++-----------------
 tests/btrfs/025.out |   12 ------------
 2 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/tests/btrfs/025 b/tests/btrfs/025
index 482467f..01b1f86 100755
--- a/tests/btrfs/025
+++ b/tests/btrfs/025
@@ -54,27 +54,27 @@ rm -f $seqres.full
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
-$XFS_IO_PROG -f -c "truncate 819200" $SCRATCH_MNT/foo | _filter_xfs_io
-$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+run_check $XFS_IO_PROG -f -c "truncate 819200" $SCRATCH_MNT/foo
+run_check $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 
-$XFS_IO_PROG -c "falloc -k 819200 667648" $SCRATCH_MNT/foo | _filter_xfs_io
-$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+run_check $XFS_IO_PROG -c "falloc -k 819200 667648" $SCRATCH_MNT/foo
+run_check $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 
-$XFS_IO_PROG -f -c "pwrite 1482752 2978" $SCRATCH_MNT/foo | _filter_xfs_io
-$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+run_check $XFS_IO_PROG -c "pwrite 1482752 2978" $SCRATCH_MNT/foo
+run_check $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1 | \
-    _filter_scratch
+run_check $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \
+    $SCRATCH_MNT/mysnap1
 
-$XFS_IO_PROG -f -c "truncate 883305" $SCRATCH_MNT/foo | _filter_xfs_io
-$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+run_check $XFS_IO_PROG -c "truncate 883305" $SCRATCH_MNT/foo
+run_check $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2 | \
-    _filter_scratch
+run_check $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \
+    $SCRATCH_MNT/mysnap2
 
-$BTRFS_UTIL_PROG send $SCRATCH_MNT/mysnap1 -f $tmp/1.snap 2>&1 | _filter_scratch
-$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
-    -f $tmp/2.snap 2>&1 | _filter_scratch
+run_check $BTRFS_UTIL_PROG send $SCRATCH_MNT/mysnap1 -f $tmp/1.snap
+run_check $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
+    -f $tmp/2.snap 2>&1
 
 md5sum $SCRATCH_MNT/foo | _filter_scratch
 md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
@@ -85,10 +85,10 @@ _check_btrfs_filesystem $SCRATCH_DEV
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
-$BTRFS_UTIL_PROG receive $SCRATCH_MNT -f $tmp/1.snap
+run_check $BTRFS_UTIL_PROG receive $SCRATCH_MNT -f $tmp/1.snap
 md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
 
-$BTRFS_UTIL_PROG receive $SCRATCH_MNT -f $tmp/2.snap
+run_check $BTRFS_UTIL_PROG receive $SCRATCH_MNT -f $tmp/2.snap
 md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
 
 _scratch_unmount
diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
index aaad4ab..9921aea 100644
--- a/tests/btrfs/025.out
+++ b/tests/btrfs/025.out
@@ -1,18 +1,6 @@
 QA output created by 025
-FSSync 'SCRATCH_MNT'
-FSSync 'SCRATCH_MNT'
-wrote 2978/2978 bytes at offset 1482752
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-FSSync 'SCRATCH_MNT'
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1'
-FSSync 'SCRATCH_MNT'
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2'
-At subvol SCRATCH_MNT/mysnap1
-At subvol SCRATCH_MNT/mysnap2
 129b8eaee8d3c2bcad49bec596591cb3  SCRATCH_MNT/foo
 42b6369eae2a8725c1aacc0440e597aa  SCRATCH_MNT/mysnap1/foo
 129b8eaee8d3c2bcad49bec596591cb3  SCRATCH_MNT/mysnap2/foo
-At subvol mysnap1
 42b6369eae2a8725c1aacc0440e597aa  SCRATCH_MNT/mysnap1/foo
-At snapshot mysnap2
 129b8eaee8d3c2bcad49bec596591cb3  SCRATCH_MNT/mysnap2/foo
-- 
1.7.9.5


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

* Re: [PATCH] xfstests: make test btrfs/025 more robust
  2014-01-28 14:46 [PATCH] xfstests: make test btrfs/025 more robust Filipe David Borba Manana
@ 2014-01-28 14:51 ` Josef Bacik
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2014-01-28 14:51 UTC (permalink / raw)
  To: Filipe David Borba Manana, xfs; +Cc: linux-btrfs


On 01/28/2014 09:46 AM, Filipe David Borba Manana wrote:
> Make the test btrfs/025 not depend on the output of the btrfs tools
> subvolume, send, receive and filesystem commands output. The output
> of these commands has changed several times in the past, and it can
> change again in the future. Therefore just test for failure/success
> and not for the exact output on the success case.
>
> Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>

Wow sorry didn't realize this already got taken, but still a good change 
to have anyway.

Reviewed-by: Josef Bacik <jbacik@fb.com>

Thanks,

Josef

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

end of thread, other threads:[~2014-01-28 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 14:46 [PATCH] xfstests: make test btrfs/025 more robust Filipe David Borba Manana
2014-01-28 14:51 ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).