[LTP] [PATCH 1/1] tst_net.sh: Filter out tst_ns_exec TINFO messages
Li Wang
liwang@redhat.com
Fri Jan 17 08:03:17 CET 2025
On Thu, Jan 16, 2025 at 9:09 PM Petr Vorel <pvorel@suse.cz> wrote:
> This is a workaround to filter out tst_ns_exec.c TINFO messages printed
> on stderr by tst_has_slow_kconfig(). tst_ns_exec.c is used by default by
> $LTP_NETNS in tst_rhost_run().
>
> This fixes errors on shell tests on netns backend (the default):
>
> # PATH="/opt/ltp/testcases/bin:$PATH" ping01.sh
> ...
> ping01 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
> /opt/ltp/testcases/bin/ping01.sh: 142: [: tst_kconfig.c:88::
> unexpected operator
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> /opt/ltp/testcases/bin/ping01.sh: 142: [: tst_kconfig.c:88::
> unexpected operator
> ping01 1 TINFO: add remote addr 10.0.0.1/24
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> /opt/ltp/testcases/bin/ping01.sh: 142: [: tst_kconfig.c:88::
> unexpected operator
> ping01 1 TINFO: add remote addr fd00:1:1:1::1/64
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected
> which might slow the execution
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: tst_kconfig.c:88:: not found
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: 34mTINFO:: not found
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: 34mTINFO:: not found
> /opt/ltp/testcases/bin/ping01.sh: 142: [: tst_kconfig.c:88::
> unexpected operator
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: tst_kconfig.c:88:: not found
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: 34mTINFO:: not found
> /opt/ltp/testcases/bin/ping01.sh: 1: eval: 34mTINFO:: not found
> ping01 1 TINFO: Network config (local -- remote):
> ping01 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
> ping01 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
>
> Fixes: 893ca0abe7 ("lib: multiply the timeout if detect slow kconfigs")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>
Reviewed-by: Li Wang <liwang@redhat.com>
---
> Hi,
>
> alternative to Li's TST_NO_SLOW_KCONFIG_CHECK suggestion:
>
> https://lore.kernel.org/ltp/CAEemH2d6RJ8yd4TcLt-z49fmNKt7eAGg=VhdASkNtE=7cR7bgg@mail.gmail.com/
>
> Maybe even both could be applied.
> WDYT?
>
Agreed, this could avoid some other new TINFO in the future.
Also, I will post the TST_NO_SLOW_KCONIFG_CHECK patch soon.
>
> Kind regards,
> Petr
>
> testcases/lib/tst_net.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index ee0ae1cad7..4e8786b704 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -265,6 +265,8 @@ tst_rhost_run()
> [ "$safe" ] && \
> tst_brk_ TBROK "'$cmd' failed on '$RHOST':
> '$output'"
> fi
> + # strip out tst_ns_exec TINFO messages
> + output=$(echo "$output" | grep -v 'TINFO:')
>
> [ -z "$out" -a -n "$output" ] && echo "$output"
>
> --
> 2.47.1
>
>
--
Regards,
Li Wang
More information about the ltp
mailing list