[LTP] [PATCH 2/2] testcases/lib: tst_net.sh: Do not use stderr in tst_rhost_run()

Cyril Hrubis chrubis@suse.cz
Fri Jan 17 13:33:05 CET 2025


Hi!
> This is another place that broke the network test on the unrelated
> changes that caused the SAFE_CLONE() to produce TINFO messages. The test
> library prints messages into the stdout, because this is something that
                                      ^
				      stderr

> is not supposed to be the command output but rather diagnostic messages.
> So there was no good reason to include the stderr in the data we got
> from the tst_rhost_run().
> 
> If this patch does not break anything it should be pushed since this
> will fix the tst_ns_* helpers even if the they start print diagnostics
> TINFO messages again.
> 
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>  testcases/lib/tst_net.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index ee0ae1cad..60bc25b79 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -257,7 +257,7 @@ tst_rhost_run()
>  		tst_res_ TINFO "$use: $rcmd \"$sh_cmd\" $out 2>&1"
>  	fi
>  
> -	output=$($rcmd "$sh_cmd" $out 2>&1 || echo 'RTERR')
> +	output=$($rcmd "$sh_cmd" $out || echo 'RTERR')
>  
>  	echo "$output" | grep -q 'RTERR$' && ret=1
>  	if [ $ret -eq 1 ]; then
> -- 
> 2.45.2
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list