MPTCP Linux Development
 help / color / mirror / Atom feed
From: Gang Yan <gang_yan@foxmail.com>
To: Matthieu Baerts <matttbe@kernel.org>,
	Mat Martineau <martineau@kernel.org>,
	Geliang Tang <geliang@kernel.org>
Cc: Gang Yan <yangang@kylinos.cn>, mptcp@lists.linux.dev
Subject: [PATCH 2/3] selftests: mptcp: relax conditions in SYN_TX validation
Date: Thu,  9 Jan 2025 21:32:21 +0800	[thread overview]
Message-ID: <tencent_501B9947760682D23ADE286C65020C801307@qq.com> (raw)

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(-)

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"
-- 
2.25.1


             reply	other threads:[~2025-01-09 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 13:32 Gang Yan [this message]
2025-01-09 17:39 ` [PATCH 2/3] selftests: mptcp: relax conditions in SYN_TX validation Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_501B9947760682D23ADE286C65020C801307@qq.com \
    --to=gang_yan@foxmail.com \
    --cc=geliang@kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=yangang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox