[PATCH mptcp-next] Squash to "selftests: mptcp: remove id 0 subflow & address"

Geliang Tang posted 1 patch 8 months, 3 weeks ago
Failed in applying to current master (apply log)
.../testing/selftests/net/mptcp/mptcp_join.sh | 72 +++++++++----------
1 file changed, 32 insertions(+), 40 deletions(-)
[PATCH mptcp-next] Squash to "selftests: mptcp: remove id 0 subflow & address"
Posted by Geliang Tang 8 months, 3 weeks ago
Remove redundant code, put two tests into one.

Patch for "userspace pm remove id 0 subflow & address" v2.

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

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 2ced5b5c64ee..b00a1634dc09 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3339,7 +3339,13 @@ userspace_pm_rm_id_0_subflow_or_address_ns2()
 	local tk
 
 	tk=$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2")
-	ip netns exec $ns2 ./pm_nl_ctl "$1" token $tk id 0
+
+	if [ "$1" == "subflow" ]; then
+		ip netns exec $ns2 ./pm_nl_ctl dsf token $tk id 0
+	elif [ "$1" == "address" ]; then
+		ip netns exec $ns2 ./pm_nl_ctl rem token $tk id 0
+	fi
+
 	sleep 0.5
 }
 
@@ -3458,45 +3464,31 @@ userspace_tests()
 		wait $tests_pid
 	fi
 
-	# userspace pm remove id 0 subflow
-	if reset_with_events "userspace pm remove id 0 subflow" &&
-	   continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
-		set_userspace_pm $ns2
-		pm_nl_set_limits $ns1 0 2
-		speed=10 \
-			run_tests $ns1 $ns2 10.0.1.1 &
-		local tests_pid=$!
-		wait_mpj $ns2
-		userspace_pm_add_sf 10.0.1.2 0
-		userspace_pm_add_sf 10.0.3.2 20
-		chk_join_nr 2 2 2
-		chk_mptcp_info subflows 2 subflows 2
-		userspace_pm_rm_id_0_subflow_or_address_ns2 dsf
-		chk_mptcp_info subflows 1 subflows 1
-		chk_rm_nr 0 2
-		kill_events_pids
-		wait $tests_pid
-	fi
-
-	# userspace pm remove id 0 address
-	if reset_with_events "userspace pm remove id 0 address" &&
-	   continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
-		set_userspace_pm $ns2
-		pm_nl_set_limits $ns1 0 2
-		speed=10 \
-			run_tests $ns1 $ns2 10.0.1.1 &
-		local tests_pid=$!
-		wait_mpj $ns2
-		userspace_pm_add_sf 10.0.1.2 0
-		userspace_pm_add_sf 10.0.3.2 20
-		chk_join_nr 2 2 2
-		chk_mptcp_info subflows 2 subflows 2
-		userspace_pm_rm_id_0_subflow_or_address_ns2 rem
-		chk_mptcp_info subflows 1 subflows 1
-		chk_rm_nr 2 0
-		kill_events_pids
-		wait $tests_pid
-	fi
+	# userspace pm remove id 0 subflow & address
+	for type in "subflow" "address"; do
+		if reset_with_events "userspace pm remove id 0 $type" &&
+		   continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
+			set_userspace_pm $ns2
+			pm_nl_set_limits $ns1 0 2
+			speed=10 \
+				run_tests $ns1 $ns2 10.0.1.1 &
+			local tests_pid=$!
+			wait_mpj $ns2
+			userspace_pm_add_sf 10.0.1.2 0
+			userspace_pm_add_sf 10.0.3.2 20
+			chk_join_nr 2 2 2
+			chk_mptcp_info subflows 2 subflows 2
+			userspace_pm_rm_id_0_subflow_or_address_ns2 "$type"
+			chk_mptcp_info subflows 1 subflows 1
+			if [ "$type" == "subflow" ]; then
+				chk_rm_nr 0 2
+			elif [ "$type" == "address" ]; then
+				chk_rm_nr 2 0
+			fi
+			kill_events_pids
+			wait $tests_pid
+		fi
+	done
 }
 
 endpoint_tests()
-- 
2.35.3
Re: Squash to "selftests: mptcp: remove id 0 subflow & address": Tests Results
Posted by MPTCP CI 8 months, 3 weeks ago
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/5693089235337216
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5693089235337216/summary/summary.txt

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

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

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

Initiator: Matthieu Baerts
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/cf8622126093


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)