All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net] selftests: mptcp: don't exit when a symbol not found
@ 2024-02-22  7:56 Geliang Tang
  2024-02-22  8:51 ` selftests: mptcp: don't exit when a symbol not found: Tests Results MPTCP CI
  2024-02-22  8:58 ` [PATCH mptcp-net] selftests: mptcp: don't exit when a symbol not found Matthieu Baerts
  0 siblings, 2 replies; 6+ messages in thread
From: Geliang Tang @ 2024-02-22  7:56 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

mptcp_lib_kallsyms_has() will always exit when a symbol has not found, it
breaks the test itself. Unexpected errors occur:

 007 userspace pm add & remove address
       syn                                 [ OK ]
       synack                              [ OK ]
       ack                                 [ OK ]
       add                                 [ OK ]
       echo                                [ OK ]
       mptcp_info subflows=2:2             [ OK ]
       mptcp_info subflows_total=3:3       [ OK ]
       mptcp_info add_addr_signal=2:2      [ OK ]
       mptcp_info last_data_sent=191:18    [ OK ]
       mptcp_info last_data_recv=40:68     [ OK ]
       mptcp_info last_ack_recv=93:74      [ OK ]
       dump addrs signal                   ERROR: missing feature: \
			mptcp_userspace_pm_dump_addr$ symbol not found
 Cannot open network namespace "ns1-65d6fb5a-5FviVK": \
			No such file or directory
 Cannot open network namespace "ns2-65d6fb5a-5FviVK": \
			No such file or directory
 cmp: /tmp/tmp.a7osJs7Nj0: No such file or directory
 cmp: /tmp/tmp.f02z6brCQu: No such file or directory
 cat: /tmp/tmp.27TzxD2efV: No such file or directory
not ok 1 test: selftest_mptcp_join # FAIL

To fix this, this patch adds a new argument 'continue' for the helper
mptcp_lib_fail_if_expected_feature() to control whether exit or not.

Always set this argument to 1 in mptcp_lib_kallsyms_has().

Fixes: 83013bdf90a ("selftests: mptcp: connect: skip if MPTCP is not supported")
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 556a7d9784d7..e23fd85902d8 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -55,11 +55,13 @@ mptcp_lib_expect_all_features() {
 	[ "${SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES:-}" = "1" ]
 }
 
-# $1: msg
+# $1: msg $2: continue or not
 mptcp_lib_fail_if_expected_feature() {
+	local continue="${2:-0}"
+
 	if mptcp_lib_expect_all_features; then
-		echo "ERROR: missing feature: ${*}"
-		exit ${KSFT_FAIL}
+		echo "ERROR: missing feature: ${1}"
+		[ "${continue}" -eq 0 ] && exit ${KSFT_FAIL}
 	fi
 
 	return 1
@@ -107,7 +109,7 @@ mptcp_lib_kallsyms_has() {
 		return 0
 	fi
 
-	mptcp_lib_fail_if_expected_feature "${sym} symbol not found"
+	mptcp_lib_fail_if_expected_feature "${sym} symbol not found" 1
 }
 
 # $1: part of a symbol to look at, add '$' at the end for full name
-- 
2.40.1


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

end of thread, other threads:[~2024-02-26  1:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22  7:56 [PATCH mptcp-net] selftests: mptcp: don't exit when a symbol not found Geliang Tang
2024-02-22  8:51 ` selftests: mptcp: don't exit when a symbol not found: Tests Results MPTCP CI
2024-02-22  8:58 ` [PATCH mptcp-net] selftests: mptcp: don't exit when a symbol not found Matthieu Baerts
2024-02-22 10:31   ` Geliang Tang
2024-02-22 10:49     ` Matthieu Baerts
2024-02-26  1:55       ` Geliang Tang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.