From patchwork Thu Oct 19 10:06:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13428546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF5F9CDB465 for ; Thu, 19 Oct 2023 10:06:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345162AbjJSKG1 (ORCPT ); Thu, 19 Oct 2023 06:06:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345188AbjJSKG0 (ORCPT ); Thu, 19 Oct 2023 06:06:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E0F12A; Thu, 19 Oct 2023 03:06:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A3CEC433C8; Thu, 19 Oct 2023 10:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697709984; bh=2RHW6eQDtzw4Pa0BgCifdvVOWoLALmZaQF83z6YwPfI=; h=From:To:Cc:Subject:Date:From; b=EYR6qWBprpUKwMl/NbUgsFFrfZ30Z2z4aSkED33FK0T+DOPokoJcRGgXIqXa3VA9f MPlCt6Gt9B4dFh2KR0ksZI+xYZSyCvU0niYPyerYf7bYuOIRp9VP9txdEVFDpAk0LX +y9sBW1+ehwnJDl3nSBwmzXjbOz+zx8qAvIn77xbExVIRa3DgugKEqKh+tO5mnEg6h bjXaIF/ZR5B8UVpQgZNcPyENyNoWAk1VvBAe912H3a4wQaZva+yZsHWy5KJ2W3rhCh bB0lKIeDiauev1NHm+OO5ukSIjKu8O99AGE0FQ4Fy4TjT4y8zyPDxGLhgSirTZX9wP YkJ5rQLvRW/yg== From: fdmanana@kernel.org To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH] btrfs/298: fix failure when added device supports trim Date: Thu, 19 Oct 2023 11:06:14 +0100 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Filipe Manana 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 Reviewed-by: Zorro Lang Reviewed-by: Anand Jain --- tests/btrfs/298 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/btrfs/298 b/tests/btrfs/298 index d5536cf3..0cea81d0 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