public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] tst_net.sh: Print netstress.c logs on unexpected error
@ 2026-01-27 13:14 Petr Vorel
  2026-01-27 13:14 ` [LTP] [PATCH 2/2] tst_net.sh: Fix tst_brk() use in tst_netload_brk() Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petr Vorel @ 2026-01-27 13:14 UTC (permalink / raw)
  To: ltp

When there is an unexpected error, logs should be printed as well to
know the reason:

    tcp_fastopen_run 1 TINFO: run server 'netstress -t 0 -d ltp_ns_veth1 -R 3 \
	-B /tmp/LTP_tcp_fastopen_run.TpwSlSogBJ'
    tcp_fastopen_run 1 TINFO: run client 'netstress -l -t 0 -H 10.0.0.1 -d ltp_ns_veth2 \
	-a 2 -r 2000 -c /tmp/LTP_tcp_fastopen_run.TpwSlSogBJ/tst_netload.res' 5 times
    tcp_fastopen_run 1 TWARN: netstress failed, ret: 6
    tcp_fastopen_run 1 TPASS: netstress passed, median time 123 ms, data: 118 124 122 125

While at it, factor out logging code into new function
tst_netload_print_log().

Fixes: da16b664e7 ("lib/tst_net: calc mean in tst_netload()")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index ec49f5fab9..20f669f56e 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -732,10 +732,15 @@ tst_wait_ipv6_dad()
 	done
 }
 
-tst_netload_brk()
+tst_netload_print_log()
 {
 	tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
 	cat tst_netload.log
+}
+
+tst_netload_brk()
+{
+	tst_netload_print_log
 	tst_brk_ $1 $2
 }
 
@@ -853,6 +858,7 @@ tst_netload()
 				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
 
 			tst_res_ TWARN "netstress failed, ret: $ret"
+			tst_netload_print_log
 			was_failure=1
 			continue
 		fi
-- 
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-01-29 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 13:14 [LTP] [PATCH 1/2] tst_net.sh: Print netstress.c logs on unexpected error Petr Vorel
2026-01-27 13:14 ` [LTP] [PATCH 2/2] tst_net.sh: Fix tst_brk() use in tst_netload_brk() Petr Vorel
2026-01-28  0:51   ` Li Wang via ltp
2026-01-29 14:17   ` Cyril Hrubis
2026-01-29 21:47     ` Petr Vorel
2026-01-28  0:51 ` [LTP] [PATCH 1/2] tst_net.sh: Print netstress.c logs on unexpected error Li Wang via ltp
2026-01-29 14:16 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox