Skip to content

Commit 7f327cb

Browse files
committed
tst_net.sh: Print netstress.c logs on unexpected error
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(). Link: https://lore.kernel.org/ltp/20260127131427.146592-1-pvorel@suse.cz/ Fixes: da16b66 ("lib/tst_net: calc mean in tst_netload()") Reviewed-by: Li Wang <liwang@redhat.com> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent 648c819 commit 7f327cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

testcases/lib/tst_net.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,15 @@ tst_wait_ipv6_dad()
732732
done
733733
}
734734

735-
tst_netload_brk()
735+
tst_netload_print_log()
736736
{
737737
tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
738738
cat tst_netload.log
739+
}
740+
741+
tst_netload_brk()
742+
{
743+
tst_netload_print_log
739744
tst_brk_ $1 $2
740745
}
741746

@@ -853,6 +858,7 @@ tst_netload()
853858
tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
854859

855860
tst_res_ TWARN "netstress failed, ret: $ret"
861+
tst_netload_print_log
856862
was_failure=1
857863
continue
858864
fi

0 commit comments

Comments
 (0)