util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] setarch: fix stderr handling in uname26 tests
@ 2020-05-27 23:20 Chris Hofstaedtler
  2020-05-28 14:01 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Hofstaedtler @ 2020-05-27 23:20 UTC (permalink / raw)
  To: util-linux; +Cc: Helge Deller

From: Helge Deller <deller@gmx.de>

A while ago stdout and stderr have been split in these testcases, but
"FATAL: kernel too old" is actually treated as an "okay" output. However
this FATAL ends up on stderr, so when it happens, it is not seen in
the captured stdout.

Fix this by merging stdout/stderr in these cases once again.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961639
Fixes: cbf858aa085e25aa5afd1d06decaea6e14a8963f
---
 tests/ts/misc/setarch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/ts/misc/setarch b/tests/ts/misc/setarch
index 7c99ccad2..6c872bf70 100755
--- a/tests/ts/misc/setarch
+++ b/tests/ts/misc/setarch
@@ -45,22 +45,22 @@ ts_init_subtest uname26
 finmsg="" # for debugging 2.6 issues
 
 echo "###### --uname-2.6 echo" >>$TS_OUTPUT
-$TS_CMD_SETARCH $ARCH -v --uname-2.6 echo "2.6 worked" >> $TS_OUTPUT 2>> $TS_ERRLOG
+$TS_CMD_SETARCH $ARCH -v --uname-2.6 echo "2.6 worked" >> $TS_OUTPUT 2>&1
 if [ $? -eq 0 ]; then
 	expected='^2.6 worked$'
 else
-	# this may happen after execvp
+	# this may happen after execvp - gets written to stderr
 	expected="^FATAL: kernel too old$"
 	finmsg+=" echo"
 fi
 sed -i "$ s/$expected/2.6 works or kernel too old/" $TS_OUTPUT
 
 echo "###### --uname-2.6 true, non-verbose" >>$TS_OUTPUT
-$TS_CMD_SETARCH $ARCH --uname-2.6 true >> $TS_OUTPUT 2>> $TS_ERRLOG
+$TS_CMD_SETARCH $ARCH --uname-2.6 true >> $TS_OUTPUT 2>&1
 if [ $? -eq 0 ]; then
 	echo "2.6 works or kernel too old" >> $TS_OUTPUT
 else
-	# this may happen after execvp
+	# this may happen after execvp - gets written to stderr
 	expected="^FATAL: kernel too old$"
 	sed -i "$ s/$expected/2.6 works or kernel too old/" $TS_OUTPUT
 	finmsg+=" true"
-- 
2.27.0.rc2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] setarch: fix stderr handling in uname26 tests
  2020-05-27 23:20 [PATCH] setarch: fix stderr handling in uname26 tests Chris Hofstaedtler
@ 2020-05-28 14:01 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2020-05-28 14:01 UTC (permalink / raw)
  To: Chris Hofstaedtler; +Cc: util-linux, Helge Deller

On Wed, May 27, 2020 at 11:20:58PM +0000, Chris Hofstaedtler wrote:
>  tests/ts/misc/setarch | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-28 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 23:20 [PATCH] setarch: fix stderr handling in uname26 tests Chris Hofstaedtler
2020-05-28 14:01 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).