mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <geliangtang@gmail.com>
Subject: [PATCH mptcp-next v3 7/8] selftests: mptcp: add infinite map mibs check
Date: Tue, 14 Sep 2021 17:19:06 +0800	[thread overview]
Message-ID: <e0a186c006a5b4f88ff5503937215696046415fe.1631610729.git.geliangtang@gmail.com> (raw)
In-Reply-To: <cover.1631610729.git.geliangtang@gmail.com>

This patch added a function chk_infi_nr to check the mibs for the
infinite mapping.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 255793c5ac4f..fe0c8f3164a7 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -615,6 +615,43 @@ chk_fail_nr()
 	fi
 }
 
+chk_infi_nr()
+{
+	local mp_infi_nr_tx=$1
+	local mp_infi_nr_rx=$2
+	local count
+	local dump_stats
+
+	printf "%-39s %s" " " "itx"
+	count=`ip netns exec $ns1 nstat -as | grep InfiniteMapTx | awk '{print $2}'`
+	[ -z "$count" ] && count=0
+	if [ "$count" != "$mp_infi_nr_tx" ]; then
+		echo "[fail] got $count infinite map[s] TX expected $mp_infi_nr_tx"
+		ret=1
+		dump_stats=1
+	else
+		echo -n "[ ok ]"
+	fi
+
+	echo -n " - irx   "
+	count=`ip netns exec $ns2 nstat -as | grep InfiniteMapRx | awk '{print $2}'`
+	[ -z "$count" ] && count=0
+	if [ "$count" != "$mp_infi_nr_rx" ]; then
+		echo "[fail] got $count infinite map[s] RX expected $mp_infi_nr_rx"
+		ret=1
+		dump_stats=1
+	else
+		echo "[ ok ]"
+	fi
+
+	if [ "${dump_stats}" = 1 ]; then
+		echo Server ns stats
+		ip netns exec $ns1 nstat -as | grep MPTcp
+		echo Client ns stats
+		ip netns exec $ns2 nstat -as | grep MPTcp
+	fi
+}
+
 chk_join_nr()
 {
 	local msg="$1"
@@ -665,6 +702,7 @@ chk_join_nr()
 	if [ $checksum -eq 1 ]; then
 		chk_csum_nr
 		chk_fail_nr 0 0
+		chk_infi_nr 0 0
 	fi
 }
 
-- 
2.31.1


  parent reply	other threads:[~2021-09-14  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14  9:18 [PATCH mptcp-next v3 0/8] The infinite mapping support Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 1/8] mptcp: add mptcp_is_data_contiguous helper Geliang Tang
2021-09-14 15:32   ` Paolo Abeni
2021-09-15  0:37     ` Mat Martineau
2021-09-14  9:19 ` [PATCH mptcp-next v3 2/8] mptcp: add start_seq in the msk Geliang Tang
2021-09-14 15:40   ` Paolo Abeni
2021-09-14  9:19 ` [PATCH mptcp-next v3 3/8] mptcp: infinite mapping sending Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 4/8] mptcp: add the fallback check Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 5/8] mptcp: infinite mapping receiving Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 6/8] mptcp: add mib for infinite map sending Geliang Tang
2021-09-14  9:19 ` Geliang Tang [this message]
2021-09-14  9:19 ` [PATCH mptcp-next v3 8/8] DO-NOT-MERGE: mptcp: mp_fail test Geliang Tang

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=e0a186c006a5b4f88ff5503937215696046415fe.1631610729.git.geliangtang@gmail.com \
    --to=geliangtang@gmail.com \
    --cc=mptcp@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).