btrfs/029: filter mkfs and cp output
authorJosef Bacik <jbacik@fb.com>
Sun, 2 Feb 2014 23:06:41 +0000 (10:06 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 2 Feb 2014 23:06:41 +0000 (10:06 +1100)
I noticed while testing a different mkfs option that btrfs/029 was
failing because it was getting the extra output from our mkfs.btrfs.
After I fixed that I was still failing because my version of cp will
spit out the source and destination files, not just the destination
file.  So redirect _scratch_mkfs to /dev/null like everybody does
and make the golden output just expect to see "cp failed" instead of
the cp specific output.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/029
tests/btrfs/029.out

index b93b6df682610a52bcd18e1e9db045c520ef39b8..80c05e31b757e880826483529ffa0b7b25d5f036 100644 (file)
@@ -66,7 +66,7 @@ mkdir $SOURCE_DIR
 
 rm -f $seqres.full
 
-_scratch_mkfs
+_scratch_mkfs > /dev/null 2>&1
 $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $SOURCE_DIR/original \
  >> $seqres.full
 
@@ -87,8 +87,8 @@ _create_reflinks_to()
     # always reflink, should fail outright
     rm -rf $1; mkdir $1
     echo "reflink=always:"
-    cp --reflink=always $SOURCE_DIR/original $1/copyfail \
-        2>&1 | _filter_testdirs
+    cp --reflink=always $SOURCE_DIR/original $1/copyfail > $seqres.full 2>&1 \
+       || echo "cp reflink failed"
 
     # The failed target actually gets created by cp:
     ls $1/copyfail | _filter_testdirs
index 655c081bbe602b90f681836922f0911ae65cf0fb..9390d95ec3a93528ce2a88e25bd35ed1c34a9b21 100644 (file)
@@ -4,12 +4,12 @@ reflink=auto:
 42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-029/original
 42d69d1a6d333a7ebdf64792a555e392  SCRATCH_MNT/test-029/copy
 reflink=always:
-cp: failed to clone 'SCRATCH_MNT/test-029/copyfail': Invalid cross-device link
+cp reflink failed
 SCRATCH_MNT/test-029/copyfail
 test reflinks across different mountpoints of same device
 reflink=auto:
 42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-029/original
 42d69d1a6d333a7ebdf64792a555e392  SCRATCH_MNT/test-bis-029/copy
 reflink=always:
-cp: failed to clone 'SCRATCH_MNT/test-bis-029/copyfail': Invalid cross-device link
+cp reflink failed
 SCRATCH_MNT/test-bis-029/copyfail