Skip to content

Commit 7e62f90

Browse files
committed
tst_net.sh: Fix tst_brk() use in tst_netload_brk()
Since 1878502 ("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. Link: https://lore.kernel.org/ltp/20260127131427.146592-2-pvorel@suse.cz/ Reviewed-by: Li Wang <liwang@redhat.com> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent 7f327cb commit 7e62f90

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

testcases/lib/tst_net.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,12 @@ tst_netload_print_log()
741741
tst_netload_brk()
742742
{
743743
tst_netload_print_log
744-
tst_brk_ $1 $2
744+
if [ "$1" != TBROK -a "$1" != TCONF ]; then
745+
tst_res_ $1 $2
746+
tst_brk_ TBROK "quit due previous failures"
747+
else
748+
tst_brk_ $1 $2
749+
fi
745750
}
746751

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

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

869873
results="$results $(cat $rfile)"
870874
passed=$((passed + 1))

0 commit comments

Comments
 (0)