diff mbox series

[mptcp-next,v3,5/5] selftests: mptcp: join: check CURRESTAB counters

Message ID ec671764e010ca002224c611aae89d829f205166.1701256112.git.geliang.tang@suse.com (mailing list archive)
State Superseded, archived
Delegated to: Paolo Abeni
Headers show
Series add MPTCP_MIB_CURRESTAB | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 58 lines checked
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ warning Unstable: 1 failed test(s): selftest_mptcp_join
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅

Commit Message

Geliang Tang Nov. 29, 2023, 11:10 a.m. UTC
This patch adds a new helper chk_cestab_nr() to check the current
established connections counter MIB_CURRESTAB.

In do_transfer(), invoke chk_cestab_nr() to check during the connection
and when the connectin closed.

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

Comments

MPTCP CI Nov. 29, 2023, 11:23 a.m. UTC | #1
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/5843851173167104
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5843851173167104/summary/summary.txt

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/6406801126588416
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6406801126588416/summary/summary.txt

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/4999426243035136
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4999426243035136/summary/summary.txt

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/5280901219745792
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5280901219745792/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a2f9b2d4aae5


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
MPTCP CI Dec. 4, 2023, 6:41 p.m. UTC | #2
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5025343417876480
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5025343417876480/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6151243324719104
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6151243324719104/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Unstable: 1 failed test(s): selftest_mptcp_join 
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 87590a43b50d..36d855a37933 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -976,6 +976,23 @@  pm_nl_set_endpoint()
 	fi
 }
 
+chk_cestab_nr()
+{
+	local ns=$1
+	local cestab=$2
+	local count
+
+	print_check "cestab"
+	count=$(mptcp_lib_get_counter ${ns} "MPTcpExtMPCurrEstab")
+	if [ -z "$count" ]; then
+		print_skip
+	elif [ "$count" != "$cestab" ]; then
+		fail_test "got $count current establish[s] expected $cestab"
+	else
+		print_ok
+	fi
+}
+
 do_transfer()
 {
 	local listener_ns="$1"
@@ -990,6 +1007,9 @@  do_transfer()
 	local fastclose=${fastclose:-""}
 	local speed=${speed:-"fast"}
 
+	local addr_nr_ns1=${addr_nr_ns1:-0}
+	local addr_nr_ns2=${addr_nr_ns2:-0}
+
 	:> "$cout"
 	:> "$sout"
 	:> "$capout"
@@ -1090,6 +1110,13 @@  do_transfer()
 
 	pm_nl_set_endpoint $listener_ns $connector_ns $connect_addr
 
+	if [ $addr_nr_ns1 != "0" ]; then
+		chk_cestab_nr $ns1 1
+	fi
+	if [ $addr_nr_ns2 != "0" ]; then
+		chk_cestab_nr $ns2 1
+	fi
+
 	wait $cpid
 	local retc=$?
 	wait $spid
@@ -1100,6 +1127,13 @@  do_transfer()
 	    kill $cappid
 	fi
 
+	if [ $addr_nr_ns1 != "0" ]; then
+		chk_cestab_nr $ns1 0
+	fi
+	if [ $addr_nr_ns2 != "0" ]; then
+		chk_cestab_nr $ns2 0
+	fi
+
 	NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
 		nstat | grep Tcp > /tmp/${listener_ns}.out
 	NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \