diff mbox series

fstests: redirect stderr to stdout in generic/269 and xfs/051

Message ID 20231031111027.3367136-1-kernel@pankajraghav.com (mailing list archive)
State New, archived
Headers show
Series fstests: redirect stderr to stdout in generic/269 and xfs/051 | expand

Commit Message

Pankaj Raghav (Samsung) Oct. 31, 2023, 11:10 a.m. UTC
From: Pankaj Raghav <p.raghav@samsung.com>

A recent commit redirected the stdout from /dev/null to $seqres.full.
That commit missed redirection of stderr to stdout which was present
before.

This leads to test failures as the stderr is going to the output:

fsstress: check_cwd stat64() returned -1 with errno: 5 (Input/output error)
fsstress: check_cwd stat64() returned -1 with errno: 5 (Input/output error)
fsstress: check_cwd failure
fsstress: check_cwd failure

Redirection of stderr to stdout is still needed because fsstress can
still return errors in generic/269 and xfs/051 as we inject enospc and
shutdown the fs respectively. These tests only care about the fs
consistency at the end.

Add the removed 2>&1 back in these two tests.

Fixes: f55e46d6 ("fstests: redirect fsstress' stdout to $seqres.full instead of /dev/null")
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
There could be more tests that might be affected by this regression but
I came across only these two when I ran the test for xfs.

 tests/generic/269 | 2 +-
 tests/xfs/051     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Filipe Manana Oct. 31, 2023, 11:43 a.m. UTC | #1
On Tue, Oct 31, 2023 at 11:11 AM Pankaj Raghav <kernel@pankajraghav.com> wrote:
>
> From: Pankaj Raghav <p.raghav@samsung.com>
>
> A recent commit redirected the stdout from /dev/null to $seqres.full.
> That commit missed redirection of stderr to stdout which was present
> before.
>
> This leads to test failures as the stderr is going to the output:
>
> fsstress: check_cwd stat64() returned -1 with errno: 5 (Input/output error)
> fsstress: check_cwd stat64() returned -1 with errno: 5 (Input/output error)
> fsstress: check_cwd failure
> fsstress: check_cwd failure
>
> Redirection of stderr to stdout is still needed because fsstress can
> still return errors in generic/269 and xfs/051 as we inject enospc and
> shutdown the fs respectively. These tests only care about the fs
> consistency at the end.
>
> Add the removed 2>&1 back in these two tests.

Wasn't this already fixed in the for-next branch?

https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=bbeaf7d1cbf2db50549cdc95b4d2099748641b1c

>
> Fixes: f55e46d6 ("fstests: redirect fsstress' stdout to $seqres.full instead of /dev/null")
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
> There could be more tests that might be affected by this regression but
> I came across only these two when I ran the test for xfs.
>
>  tests/generic/269 | 2 +-
>  tests/xfs/051     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/generic/269 b/tests/generic/269
> index b852f6bf..eddca10d 100755
> --- a/tests/generic/269
> +++ b/tests/generic/269
> @@ -23,7 +23,7 @@ _workout()
>         out=$SCRATCH_MNT/fsstress.$$
>         args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
>         echo "fsstress $args" >> $seqres.full
> -       $FSSTRESS_PROG $args >> $seqres.full &
> +       $FSSTRESS_PROG $args >> $seqres.full 2>&1 &
>         pid=$!
>         echo "Run dd writers in parallel"
>         for ((i=0; i < num_iterations; i++))
> diff --git a/tests/xfs/051 b/tests/xfs/051
> index 1c670964..eca67bb8 100755
> --- a/tests/xfs/051
> +++ b/tests/xfs/051
> @@ -38,7 +38,7 @@ _scratch_mount
>
>  # Start a workload and shutdown the fs. The subsequent mount will require log
>  # recovery.
> -$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT >> $seqres.full &
> +$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT >> $seqres.full 2>&1 &
>  sleep 5
>  _scratch_shutdown -f
>  $KILLALL_PROG -q $FSSTRESS_PROG
> --
> 2.40.1
>
>
Pankaj Raghav Oct. 31, 2023, 11:48 a.m. UTC | #2
>> Add the removed 2>&1 back in these two tests.
> 
> Wasn't this already fixed in the for-next branch?
> 
> https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=bbeaf7d1cbf2db50549cdc95b4d2099748641b1c
> 
Ah, you are right. I am not too familiar with xfstests workflow, so I just pulled
the latest master and these changes were not there.

Thanks for the commit info. I will use for-next branch for now.

>>
>> Fixes: f55e46d6 ("fstests: redirect fsstress' stdout to $seqres.full instead of /dev/null")
>> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
>> ---
diff mbox series

Patch

diff --git a/tests/generic/269 b/tests/generic/269
index b852f6bf..eddca10d 100755
--- a/tests/generic/269
+++ b/tests/generic/269
@@ -23,7 +23,7 @@  _workout()
 	out=$SCRATCH_MNT/fsstress.$$
 	args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
 	echo "fsstress $args" >> $seqres.full
-	$FSSTRESS_PROG $args >> $seqres.full &
+	$FSSTRESS_PROG $args >> $seqres.full 2>&1 &
 	pid=$!
 	echo "Run dd writers in parallel"
 	for ((i=0; i < num_iterations; i++))
diff --git a/tests/xfs/051 b/tests/xfs/051
index 1c670964..eca67bb8 100755
--- a/tests/xfs/051
+++ b/tests/xfs/051
@@ -38,7 +38,7 @@  _scratch_mount
 
 # Start a workload and shutdown the fs. The subsequent mount will require log
 # recovery.
-$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT >> $seqres.full &
+$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT >> $seqres.full 2>&1 &
 sleep 5
 _scratch_shutdown -f
 $KILLALL_PROG -q $FSSTRESS_PROG