All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@suse.com>
Subject: [PATCH 3/3] btrfs: fix failure of tests that use defrag on btrfs-progs v6.0+
Date: Wed,  9 Nov 2022 11:43:36 +0000	[thread overview]
Message-ID: <d2723c3a1b0205c68f5e62ed5156672d93b2e270.1667993961.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1667993961.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

Starting with btrfs-progs v6.0, the defrag command now prints to stdout
the full path of the files it processes. This makes test cases btrfs/021
and btrfs/256 fail because they don't expect any output from the defrag
command.

The change happened with the following commit in btrfs-progs:

  dd724f21803d ("btrfs-progs: add logic to handle LOG_DEFAULT messages")

So update the tests to ignore the stdout of the defrag command.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/btrfs/021 | 4 +++-
 tests/btrfs/256 | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/btrfs/021 b/tests/btrfs/021
index 5943da2f..1b55834a 100755
--- a/tests/btrfs/021
+++ b/tests/btrfs/021
@@ -22,8 +22,10 @@ run_test()
 
 	sleep 0.5
 
+	# In new versions of btrfs-progs (6.0+), the defrag command outputs to
+	# stdout the path of the files it operates on. So ignore that.
 	find $SCRATCH_MNT -type f -print0 | xargs -0 \
-	$BTRFS_UTIL_PROG filesystem defrag -f
+		$BTRFS_UTIL_PROG filesystem defrag -f > /dev/null
 
 	sync
 	wait
diff --git a/tests/btrfs/256 b/tests/btrfs/256
index 1360c2c2..acbbc6fa 100755
--- a/tests/btrfs/256
+++ b/tests/btrfs/256
@@ -50,7 +50,9 @@ $FSSUM_PROG -A -f -w "$checksums_file" "$SCRATCH_MNT"
 # Now defrag each file.
 for sz in ${file_sizes[@]}; do
 	echo "Defragging file with $sz bytes..." >> $seqres.full
-	$BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz"
+	# In new versions of btrfs-progs (6.0+), the defrag command outputs to
+	# stdout the path of the files it operates on. So ignore that.
+	$BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz" > /dev/null
 done
 
 # Verify the checksums after the defrag operations.
-- 
2.35.1


  parent reply	other threads:[~2022-11-09 11:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 11:43 [PATCH 0/3] btrfs: fix some test failures with btrfs-progs 5.19 and 6.0 fdmanana
2022-11-09 11:43 ` [PATCH 1/3] btrfs/003: fix failure on new btrfs-progs versions fdmanana
2022-11-09 15:37   ` Zorro Lang
2022-11-09 11:43 ` [PATCH 2/3] btrfs/053: fix test failure when running with btrfs-progs v6.0+ fdmanana
2022-11-09 15:55   ` Zorro Lang
2022-11-09 16:43     ` Filipe Manana
2022-11-09 11:43 ` fdmanana [this message]
2022-11-09 16:01   ` [PATCH 3/3] btrfs: fix failure of tests that use defrag on " Zorro Lang
2022-11-09 16:44 ` [PATCH v2 0/3] btrfs: fix some test failures with btrfs-progs 5.19 and 6.0 fdmanana
2022-11-09 16:44   ` [PATCH v2 1/3] btrfs/003: fix failure on new btrfs-progs versions fdmanana
2022-11-14 11:19     ` Qu Wenruo
2022-11-09 16:44   ` [PATCH v2 3/3] btrfs: fix failure of tests that use defrag on btrfs-progs v6.0+ fdmanana
2022-11-14 11:09     ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2723c3a1b0205c68f5e62ed5156672d93b2e270.1667993961.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.