From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: fdmanana@kernel.org, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] fstests: remove unnecessary stdout/stderr redirection for run_check calls
Date: Thu, 1 Aug 2024 09:00:28 +0930 [thread overview]
Message-ID: <b0876bf8-08ae-4b34-82bb-5f044a135f5b@gmx.com> (raw)
In-Reply-To: <742c2d98a000e324106a9f5bd3498f2985bb2706.1722441541.git.fdmanana@suse.com>
在 2024/8/1 01:29, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> It's pointless, and confusing, to have calls to run_check redirect the
> stdout and/or stderr, because run_check already redirects it:
>
> $ cat common/rc
> (...)
> run_check()
> {
> echo "# $@" >> $seqres.full 2>&1
> "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'"
> }
> (...)
>
> So remove those redirections.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> tests/btrfs/004 | 4 ++--
> tests/btrfs/030 | 4 ++--
> tests/btrfs/038 | 6 +++---
> tests/btrfs/039 | 4 ++--
> tests/btrfs/040 | 4 ++--
> tests/btrfs/057 | 6 ++----
> tests/btrfs/284 | 2 +-
> tests/generic/482 | 2 +-
> 8 files changed, 15 insertions(+), 17 deletions(-)
>
> diff --git a/tests/btrfs/004 b/tests/btrfs/004
> index e89697d2..5a2ce993 100755
> --- a/tests/btrfs/004
> +++ b/tests/btrfs/004
> @@ -165,7 +165,7 @@ workout()
> _btrfs subvolume snapshot $SCRATCH_MNT \
> $SCRATCH_MNT/$snap_name
>
> - run_check _scratch_unmount >/dev/null 2>&1
> + run_check _scratch_unmount
> _scratch_mount "-o compress=lzo"
>
> # make some noise but ensure we're not touching existing data
> @@ -179,7 +179,7 @@ workout()
> # now make more files to get a higher tree
> run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
> $FSSTRESS_AVOID
> - run_check _scratch_unmount >/dev/null 2>&1
> + run_check _scratch_unmount
> _scratch_mount "-o atime"
>
> if [ $do_bg_noise -ne 0 ]; then
> diff --git a/tests/btrfs/030 b/tests/btrfs/030
> index bedbb728..0c84000a 100755
> --- a/tests/btrfs/030
> +++ b/tests/btrfs/030
> @@ -150,10 +150,10 @@ _scratch_mkfs >/dev/null 2>&1
> _scratch_mount
>
> _btrfs receive -f $tmp/1.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1
>
> _btrfs receive -f $tmp/2.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2
>
> _scratch_unmount
> _check_btrfs_filesystem $SCRATCH_DEV
> diff --git a/tests/btrfs/038 b/tests/btrfs/038
> index bdef4f41..1e6defa9 100755
> --- a/tests/btrfs/038
> +++ b/tests/btrfs/038
> @@ -76,13 +76,13 @@ _scratch_mkfs >/dev/null 2>&1
> _scratch_mount
>
> _btrfs receive -f $tmp/1.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1
>
> _btrfs receive -f $tmp/clones.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/clones.fssum $SCRATCH_MNT/clones_snap 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/clones.fssum $SCRATCH_MNT/clones_snap
>
> _btrfs receive -f $tmp/2.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2
>
> _scratch_unmount
> _check_btrfs_filesystem $SCRATCH_DEV
> diff --git a/tests/btrfs/039 b/tests/btrfs/039
> index e7cea325..2306ffe0 100755
> --- a/tests/btrfs/039
> +++ b/tests/btrfs/039
> @@ -91,10 +91,10 @@ _scratch_mkfs >/dev/null 2>&1
> _scratch_mount
>
> _btrfs receive -f $tmp/1.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1
>
> _btrfs receive -f $tmp/2.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2
>
> _scratch_unmount
> _check_btrfs_filesystem $SCRATCH_DEV
> diff --git a/tests/btrfs/040 b/tests/btrfs/040
> index 5d346be3..4fc4db44 100755
> --- a/tests/btrfs/040
> +++ b/tests/btrfs/040
> @@ -84,10 +84,10 @@ _scratch_mkfs >/dev/null 2>&1
> _scratch_mount
>
> _btrfs receive -f $tmp/1.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1
>
> _btrfs receive -f $tmp/2.snap $SCRATCH_MNT
> -run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 2>> $seqres.full
> +run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2
>
> _scratch_unmount
> _check_btrfs_filesystem $SCRATCH_DEV
> diff --git a/tests/btrfs/057 b/tests/btrfs/057
> index 07e60557..6c399946 100755
> --- a/tests/btrfs/057
> +++ b/tests/btrfs/057
> @@ -19,14 +19,12 @@ _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1
> _scratch_mount
>
> # -w ensures that the only ops are ones which cause write I/O
> -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
> - $FSSTRESS_AVOID >&/dev/null
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 $FSSTRESS_AVOID
>
> _btrfs subvolume snapshot $SCRATCH_MNT \
> $SCRATCH_MNT/snap1
>
> -run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
> - $FSSTRESS_AVOID >&/dev/null
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 $FSSTRESS_AVOID
>
> _btrfs quota enable $SCRATCH_MNT
> _btrfs quota rescan -w $SCRATCH_MNT
> diff --git a/tests/btrfs/284 b/tests/btrfs/284
> index 19ffbbe6..6c554f32 100755
> --- a/tests/btrfs/284
> +++ b/tests/btrfs/284
> @@ -50,7 +50,7 @@ run_send_test()
> # Use a single process so that in case of failure it's easier to
> # reproduce by using the same seed (logged in $seqres.full).
> run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \
> - -w $FSSTRESS_AVOID -x "$snapshot_cmd" >> $seqres.full
> + -w $FSSTRESS_AVOID -x "$snapshot_cmd"
>
> $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \
> >> $seqres.full
> diff --git a/tests/generic/482 b/tests/generic/482
> index 04026c4c..54fee07d 100755
> --- a/tests/generic/482
> +++ b/tests/generic/482
> @@ -77,7 +77,7 @@ _log_writes_mkfs >> $seqres.full 2>&1
> _log_writes_mark mkfs
>
> _log_writes_mount
> -run_check $FSSTRESS_PROG $fsstress_args > /dev/null 2>&1
> +run_check $FSSTRESS_PROG $fsstress_args
> _log_writes_unmount
>
> _log_writes_remove
prev parent reply other threads:[~2024-07-31 23:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 15:59 [PATCH] fstests: remove unnecessary stdout/stderr redirection for run_check calls fdmanana
2024-07-31 23:30 ` Qu Wenruo [this message]
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=b0876bf8-08ae-4b34-82bb-5f044a135f5b@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox