aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-10-19 11:06:14 +0100
committerZorro Lang <zlang@kernel.org>2023-10-22 14:45:42 +0800
commit6409d61958c58825b863dda6e1fc709b44206ce0 (patch)
tree01295425891ded2ea14543b3d2daed07dbdb8afd
parentd9323ad7a05e2705fbd31d5e7c6031bba23b1706 (diff)
downloadxfstests-dev-6409d61958c58825b863dda6e1fc709b44206ce0.tar.gz
btrfs/298: fix failure when added device supports trim
A btrfs device add command issues a trim on the device if the device supports trim, and then it outputs a message to stdout informing that it performed a trim. If that happens it breaks the golden output and the test fails like this: $ ./check btrfs/298 FSTYP -- btrfs PLATFORM -- Linux/x86_64 debian0 6.6.0-rc3-btrfs-next-139+ #1 SMP PREEMPT_DYNAMIC Tue Oct 3 13:52:02 WEST 2023 MKFS_OPTIONS -- /dev/sdc MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1 btrfs/298 - output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/298.out.bad) --- tests/btrfs/298.out 2023-10-18 23:29:06.029292800 +0100 +++ /home/fdmanana/git/hub/xfstests/results//btrfs/298.out.bad 2023-10-19 10:54:29.693210881 +0100 @@ -1,2 +1,3 @@ QA output created by 298 +Performing full device TRIM /dev/sdd (100.00GiB) ... Silence is golden ... (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/298.out /home/fdmanana/git/hub/xfstests/results//btrfs/298.out.bad' to see the entire diff) Ran: btrfs/298 Failures: btrfs/298 Failed 1 of 1 tests Fix this by redirecting the device add's stdout to the $seqres.full file. Any device add errors are sent to stderr, so we'll notice if errors happen due to possible future regressions, as it will break the golden output. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-xtests/btrfs/2982
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/btrfs/298 b/tests/btrfs/298
index d5536cf3ed..0cea81d099 100755
--- a/tests/btrfs/298
+++ b/tests/btrfs/298
@@ -25,7 +25,7 @@ _scratch_mkfs "-b 300M" >> $seqres.full 2>&1 || \
_fail "Fail to make SCRATCH_DEV with -b 300M"
$BTRFS_TUNE_PROG -S 1 $SCRATCH_DEV
_scratch_mount >> $seqres.full 2>&1
-$BTRFS_UTIL_PROG device add $SPARE_DEV $SCRATCH_MNT
+$BTRFS_UTIL_PROG device add $SPARE_DEV $SCRATCH_MNT >> $seqres.full
_scratch_unmount
$BTRFS_UTIL_PROG device scan --forget