Skip to contentSkip to conversation

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

PATCH In review Pankaj Raghav 3 participants 3 messages Oct 31, 2023

lore
Share & tools
lore
#0 lore raw

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

From: Pankaj Raghav <[email protected]>

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")

---
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(-)
tests/generic/269 +1 -1
index b852f6bf..eddca10d 100755
@@ -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++))
tests/xfs/051 +1 -1
index 1c670964..eca67bb8 100755
@@ -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
Signature · 1 line
2.40.1
#1 lore raw
Quoted 14 lines · Pankaj Raghav

From: Pankaj Raghav <[email protected]>

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

Quoted 6 lines

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

Quoted 41 lines
Fixes f55e46d6 ("fstests: redirect fsstress' stdout to $seqres.full instead of /dev/null")

---
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(-)
tests/generic/269 +1 -1
index b852f6bf..eddca10d 100755
@@ -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++))
tests/xfs/051 +1 -2
index 1c670964..eca67bb8 100755
@@ -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

#2 lore raw
Quoted 6 lines
Quoted 1 line

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.

Quoted 4 lines
Quoted 4 lines
Fixes f55e46d6 ("fstests: redirect fsstress' stdout to $seqres.full instead of /dev/null")

---