aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-11-22 09:53:41 -0500
committerEryu Guan <guaneryu@gmail.com>2021-11-28 22:36:22 +0800
commitefffdefa4a1374142e36ba41f58b87dee732912c (patch)
treeb7f57f23422998cdfdd3e495dbca6812fe32fc72
parent6085f8144c2439cba55cbb31882c3122ea4fe7c6 (diff)
downloadxfstests-dev-efffdefa4a1374142e36ba41f58b87dee732912c.tar.gz
btrfs: redirect device replace output to $seqres.full
The btrfs utils are printing a status message about TRIM'ing device on replace and this is throwing off the golden output, redirect stdout from 'device replace start' to $seqres.full so we don't get false negatives. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-xtests/btrfs/1766
-rwxr-xr-xtests/btrfs/2232
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/btrfs/176 b/tests/btrfs/176
index 0e6230ec79..33f9a061fe 100755
--- a/tests/btrfs/176
+++ b/tests/btrfs/176
@@ -53,10 +53,12 @@ swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
# Again, we know the swap file is on device 1.
$BTRFS_UTIL_PROG replace start -fB "$scratch_dev1" "$scratch_dev3" "$SCRATCH_MNT" 2>&1 | grep -o "Text file busy"
# Replacing device 2 should still work.
-$BTRFS_UTIL_PROG replace start -fB "$scratch_dev2" "$scratch_dev3" "$SCRATCH_MNT"
+$BTRFS_UTIL_PROG replace start -fB "$scratch_dev2" "$scratch_dev3" "$SCRATCH_MNT" \
+ >> $seqres.full
swapoff "$SCRATCH_MNT/swap" > /dev/null 2>&1
# Replacing device 1 should work again after swapoff.
-$BTRFS_UTIL_PROG replace start -fB "$scratch_dev1" "$scratch_dev2" "$SCRATCH_MNT"
+$BTRFS_UTIL_PROG replace start -fB "$scratch_dev1" "$scratch_dev2" "$SCRATCH_MNT" \
+ >> $seqres.full
_scratch_unmount
_check_scratch_fs "$scratch_dev2"
diff --git a/tests/btrfs/223 b/tests/btrfs/223
index af072ede17..8125cdf257 100755
--- a/tests/btrfs/223
+++ b/tests/btrfs/223
@@ -33,7 +33,7 @@ _require_batched_discard $SCRATCH_MNT
$XFS_IO_PROG -f -c "pwrite -S 0xab 0 10M" $SCRATCH_MNT/foo | _filter_xfs_io
# Replace the first device, $dev1, with a new device.
-$BTRFS_UTIL_PROG replace start -Bf $dev1 $SPARE_DEV $SCRATCH_MNT
+$BTRFS_UTIL_PROG replace start -Bf $dev1 $SPARE_DEV $SCRATCH_MNT >> $seqres.full
# Run fstrim, it should not trim/discard allocated extents in the new device.
$FSTRIM_PROG $SCRATCH_MNT