All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests
@ 2023-03-09 12:33 Geliang Tang
  2023-03-09 13:24 ` selftests: mptcp: add mptcp_info tests: Tests Results MPTCP CI
  2023-03-09 15:07 ` [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2023-03-09 12:33 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

This patch adds the mptcp_info fields tests in endpoint_tests(). Add a
new function chk_mptcp_info() to check the given number of the given
mptcp_info field.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/330
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
v2:
 - use '-D' option instead of '-i'.

v3:
 - add tests in endpoint_tests() instead.

v4:
 - update endpoint_tests as Matt suggested.
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 47 ++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 42e3bd1a05f5..fafd19ec7e1f 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1719,6 +1719,46 @@ chk_subflow_nr()
 	fi
 }
 
+chk_mptcp_info()
+{
+	local nr_info=$1
+	local info
+	local cnt1
+	local cnt2
+	local dump_stats
+
+	if [[ $nr_info = "subflows_"* ]]; then
+		info="subflows"
+		nr_info=${nr_info:9}
+	else
+		echo "[fail] unsupported argument: $nr_info"
+		fail_test
+		return 1
+	fi
+
+	printf "%-${nr_blank}s %-30s" " " "mptcp_info $info=$nr_info"
+
+	cnt1=$(ss -N $ns1 -inmHM | grep "$info:" |
+		sed -n 's/.*\('"$info"':\)\([[:digit:]]*\).*$/\2/p;q')
+	[ -z "$cnt1" ] && cnt1=0
+	cnt2=$(ss -N $ns2 -inmHM | grep "$info:" |
+		sed -n 's/.*\('"$info"':\)\([[:digit:]]*\).*$/\2/p;q')
+	[ -z "$cnt2" ] && cnt2=0
+	if [ "$cnt1" != "$nr_info" ] || [ "$cnt2" != "$nr_info" ]; then
+		echo "[fail] got $cnt1:$cnt2 $info expected $nr_info"
+		fail_test
+		dump_stats=1
+	else
+		echo "[ ok ]"
+	fi
+
+	if [ "$dump_stats" = 1 ]; then
+		ss -N $ns1 -inmHM
+		ss -N $ns2 -inmHM
+		dump_stats
+	fi
+}
+
 chk_link_usage()
 {
 	local ns=$1
@@ -3118,13 +3158,18 @@ endpoint_tests()
 		run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 2>/dev/null &
 
 		wait_mpj $ns2
+		chk_subflow_nr needtitle "before delete" 2
+		chk_mptcp_info subflows_1
+
 		pm_nl_del_endpoint $ns2 2 10.0.2.2
 		sleep 0.5
-		chk_subflow_nr needtitle "after delete" 1
+		chk_subflow_nr "" "after delete" 1
+		chk_mptcp_info subflows_0
 
 		pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow
 		wait_mpj $ns2
 		chk_subflow_nr "" "after re-add" 2
+		chk_mptcp_info subflows_1
 		kill_tests_wait
 	fi
 }
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: selftests: mptcp: add mptcp_info tests: Tests Results
  2023-03-09 12:33 [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Geliang Tang
@ 2023-03-09 13:24 ` MPTCP CI
  2023-03-09 15:07 ` [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: MPTCP CI @ 2023-03-09 13:24 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

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/6237066632101888
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6237066632101888/summary/summary.txt

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

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

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

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


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests
  2023-03-09 12:33 [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Geliang Tang
  2023-03-09 13:24 ` selftests: mptcp: add mptcp_info tests: Tests Results MPTCP CI
@ 2023-03-09 15:07 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2023-03-09 15:07 UTC (permalink / raw)
  To: Geliang Tang, mptcp

Hi Geliang,

On 09/03/2023 13:33, Geliang Tang wrote:
> This patch adds the mptcp_info fields tests in endpoint_tests(). Add a
> new function chk_mptcp_info() to check the given number of the given
> mptcp_info field.

Thank you for this v4, it looks good to me!

Now in our tree (feat. for net-next) with my RvB tag:

New patches for t/upstream:
- c896d1975c77: selftests: mptcp: add mptcp_info tests
- Results: 9779a995c2fe..6a60ac3765b9 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230309T150631

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-09 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 12:33 [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Geliang Tang
2023-03-09 13:24 ` selftests: mptcp: add mptcp_info tests: Tests Results MPTCP CI
2023-03-09 15:07 ` [PATCH mptcp-next v4] selftests: mptcp: add mptcp_info tests Matthieu Baerts

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.