[LTP] [PATCH 2/2] tst_net.sh: Fix tst_brk() use in tst_netload_brk()

Petr Vorel
2026-01-27T13:14:57Z

Since 1878502f63 ("tst_test.sh/tst_brk(): Allow only TBROK and TCONF")
it's not possible to use tst_brk() with TFAIL. Call tst_res() followed
by tst_brk() for TFAIL/TWARN.

Also convert failure on missing file to TBROK.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Alternative would be to revert 1878502f63.

testcases/lib/tst_net.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 20f669f56e..76f6b20e31 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -741,7 +741,12 @@ tst_netload_print_log()
tst_netload_brk()
{
tst_netload_print_log
- tst_brk_ $1 $2
+ if [ "$1" != TBROK -a "$1" != TCONF ]; then
+ tst_res_ $1 $2
+ tst_brk_ TBROK "quit due previous failures"
+ else
+ tst_brk_ $1 $2
+ fi
}

# Run network load test, see 'netstress -h' for option description
@@ -863,8 +868,7 @@ tst_netload()
continue
fi

- [ ! -f $rfile ] && \
- tst_netload_brk TFAIL "can't read $rfile"
+ [ ! -f $rfile ] && tst_netload_brk TBROK "can't read $rfile"

results="$results $(cat $rfile)"
passed=$((passed + 1))
--
2.51.0