All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: [PATCH mptcp-next v2 3/3] selftests: mptcp: add last time actions tests
Date: Fri, 29 Mar 2024 17:07:01 +0800	[thread overview]
Message-ID: <5dd35f7df3332535dc938d1dfcc1c41ee7c717f0.1711702915.git.tanggeliang@kylinos.cn> (raw)
In-Reply-To: <cover.1711702915.git.tanggeliang@kylinos.cn>

From: Geliang Tang <tanggeliang@kylinos.cn>

This patch adds a new helper chk_msk_info() to show the counters in
mptcp_info of the given infos, and check that the timestamps move
forward. Use it to show newly added last_data_sent, last_data_recv
and last_ack_recv in mptcp_info in diag.sh.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/diag.sh | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh
index bc97ab33a00e..6e865f95f85e 100755
--- a/tools/testing/selftests/net/mptcp/diag.sh
+++ b/tools/testing/selftests/net/mptcp/diag.sh
@@ -200,6 +200,27 @@ chk_msk_cestab()
 		 "${expected}" "${msg}" ""
 }
 
+chk_msk_info()
+{
+	local info
+
+	for info in "${@}"; do
+		local cnt1 cnt2 msg
+
+		cnt1=$(ss -N ${ns} -inmHM | mptcp_lib_get_info_value "$info" "$info")
+		cnt2=$(ss -N ${ns} -inmHM | mptcp_lib_get_info_value "$info" "$info")
+		msg="....chk ${info:0:15}=$cnt1:$cnt2"
+		mptcp_lib_print_title "${msg}"
+		if [ "${cnt1}" -lt "${cnt2}" ]; then
+			mptcp_lib_pr_ok
+			mptcp_lib_result_pass "${msg}"
+		else
+			mptcp_lib_pr_skip
+			mptcp_lib_result_skip "${msg}"
+		fi
+	done
+}
+
 wait_connected()
 {
 	local listener_ns="${1}"
@@ -237,6 +258,7 @@ chk_msk_remote_key_nr 2 "....chk remote_key"
 chk_msk_fallback_nr 0 "....chk no fallback"
 chk_msk_inuse 2
 chk_msk_cestab 2
+chk_msk_info last_data_sent last_data_recv last_ack_recv
 flush_pids
 
 chk_msk_inuse 0 "2->0"
@@ -257,6 +279,7 @@ wait_connected $ns 10001
 chk_msk_fallback_nr 1 "check fallback"
 chk_msk_inuse 1
 chk_msk_cestab 1
+chk_msk_info last_data_sent last_data_recv last_ack_recv
 flush_pids
 
 chk_msk_inuse 0 "1->0"
@@ -283,6 +306,7 @@ done
 wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present"
 chk_msk_inuse $((NR_CLIENTS*2)) "many"
 chk_msk_cestab $((NR_CLIENTS*2)) "many"
+chk_msk_info last_data_sent last_data_recv last_ack_recv
 flush_pids
 
 chk_msk_inuse 0 "many->0"
-- 
2.40.1


  parent reply	other threads:[~2024-03-29  9:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  9:06 [PATCH mptcp-next v2 0/3] display "last time" actions info Geliang Tang
2024-03-29  9:06 ` [PATCH mptcp-next v2 1/3] mptcp: add last time fields in mptcp_sock Geliang Tang
2024-03-29  9:07 ` [PATCH mptcp-next v2 2/3] mptcp: add last time fields in mptcp_info Geliang Tang
2024-03-29  9:07 ` Geliang Tang [this message]
2024-03-29 16:15   ` [PATCH mptcp-next v2 3/3] selftests: mptcp: add last time actions tests Matthieu Baerts
2024-03-29 10:00 ` [PATCH mptcp-next v2 0/3] display "last time" actions info MPTCP CI

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=5dd35f7df3332535dc938d1dfcc1c41ee7c717f0.1711702915.git.tanggeliang@kylinos.cn \
    --to=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@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 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.