mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: net: exit with test failure status
@ 2026-10-14  5:32 Hangbin Liu
  2026-10-18 11:48 ` Ido Schimmel
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2026-10-14  5:32 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, David Ahern, Ido Schimmel
  Cc: Hangbin Liu, netdev, linux-kselftest, linux-kernel, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

fdb_flush.sh, fib-onlink-tests.sh and l2tp.sh can print [FAIL]
subtests while still exiting with status 0. Their log_test(), aka
log_test_expected() in lib.sh, helpers record a failure in ret, but
the scripts never propagate ret to the exit code, so a kselftest runner
treats the run as a pass.

Initialize ret and exit with it at the end of each script so failed
subtests are reflected in the exit status.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
The patch doesn't fix a regression, nothing is failing (or passing when it
shouldn't) because of it. So target the patch to net-next.
---
 tools/testing/selftests/net/fdb_flush.sh        | 3 +++
 tools/testing/selftests/net/fib-onlink-tests.sh | 3 +++
 tools/testing/selftests/net/l2tp.sh             | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/tools/testing/selftests/net/fdb_flush.sh b/tools/testing/selftests/net/fdb_flush.sh
index 4965e52d5ef5..0827fdd60f8c 100755
--- a/tools/testing/selftests/net/fdb_flush.sh
+++ b/tools/testing/selftests/net/fdb_flush.sh
@@ -6,6 +6,7 @@
 # some combinations of arguments.
 
 source lib.sh
+ret=0
 
 FLUSH_BY_STATE_TESTS="
 	vxlan_test_flush_by_permanent
@@ -778,3 +779,5 @@ for t in $TESTS
 do
 	setup; $t; cleanup;
 done
+
+exit $ret
diff --git a/tools/testing/selftests/net/fib-onlink-tests.sh b/tools/testing/selftests/net/fib-onlink-tests.sh
index a26075abf7d2..325da693c918 100755
--- a/tools/testing/selftests/net/fib-onlink-tests.sh
+++ b/tools/testing/selftests/net/fib-onlink-tests.sh
@@ -6,6 +6,7 @@
 source lib.sh
 PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
 VERBOSE=0
+ret=0
 
 # Network interfaces
 # - odd in current namespace; even in peer ns
@@ -473,3 +474,5 @@ if [ "$TESTS" != "none" ]; then
 	printf "\nTests passed: %3d\n" ${nsuccess}
 	printf "Tests failed: %3d\n"   ${nfail}
 fi
+
+exit $ret
diff --git a/tools/testing/selftests/net/l2tp.sh b/tools/testing/selftests/net/l2tp.sh
index 41e8b19d1bd3..de4b5da2da1b 100755
--- a/tools/testing/selftests/net/l2tp.sh
+++ b/tools/testing/selftests/net/l2tp.sh
@@ -16,6 +16,7 @@
 source lib.sh
 VERBOSE=0
 PAUSE_ON_FAIL=no
+ret=0
 
 which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
 
@@ -357,3 +358,5 @@ cleanup
 
 printf "\nTests passed: %3d\n" ${nsuccess}
 printf "Tests failed: %3d\n"   ${nfail}
+
+exit $ret

---
base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
change-id: 20261014-self_ret-83b030f32ba3

Best regards,
-- 
Hangbin Liu <liuhangbin@kylinos.cn>


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

end of thread, other threads:[~2026-10-19  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14  5:32 [PATCH net-next] selftests: net: exit with test failure status Hangbin Liu
2026-10-18 11:48 ` Ido Schimmel
2026-10-19  0:33   ` Hangbin Liu

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

all inboxes | Powered by JetHome®