diff mbox series

[2/3] selftests: mptcp: relax conditions in SYN_TX validation

Message ID tencent_501B9947760682D23ADE286C65020C801307@qq.com (mailing list archive)
State Changes Requested
Delegated to: Geliang Tang
Headers show
Series [1/3] mptcp: fix invalid addr occupy 'add_addr_accepted' | expand

Commit Message

Gang Yan Jan. 9, 2025, 1:32 p.m. UTC
From: Gang Yan <yangang@kylinos.cn>

In ADD_ADDR timeout test cases, the syn_tx MIB counter is not an
accurate number. This patch introduces '+n' to 'join_syn_tx'
to relax the strict condition.

Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Matthieu Baerts Jan. 9, 2025, 5:39 p.m. UTC | #1
Hi Gang,

On 09/01/2025 14:32, Gang Yan wrote:
> From: Gang Yan <yangang@kylinos.cn>
> 
> In ADD_ADDR timeout test cases, the syn_tx MIB counter is not an
> accurate number.

Please explain why this counter is not an accurate number.

When you say that, it sounds like there is something to fix in the
kernel, but not in the tests.

(It might help to squash this patch with the next one, or to rephrase it
to say that a future test will do some retransmissions)

> This patch introduces '+n' to 'join_syn_tx'
> to relax the strict condition.
(...)

Cheers,
Matt
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index c07e2bd3a315..6b0705d10840 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1361,13 +1361,20 @@  chk_join_tx_nr()
 	local create=${join_create_err:-0}
 	local bind=${join_bind_err:-0}
 	local connect=${join_connect_err:-0}
+	local allow_multi_syn_tx=0
 	local rc=${KSFT_PASS}
 	local count
 
+	if [[ "${join_syn_tx}" = "+"* ]]; then
+                allow_multi_syn_tx=1
+                syn_tx=${join_syn_tx:1}
+        fi
+
 	count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTx")
 	if [ -z "$count" ]; then
 		rc=${KSFT_SKIP}
-	elif [ "$count" != "$syn_tx" ]; then
+	elif { [ "$count" != $syn_tx ] && [ $allow_multi_syn_tx -eq 0 ]; } ||
+             { [ "$count" -lt $syn_tx ] && [ $allow_multi_syn_tx -eq 1 ]; }; then
 		rc=${KSFT_FAIL}
 		print_check "syn tx"
 		fail_test "got $count JOIN[s] syn tx expected $syn_tx"