summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/mptcp/mptcp_join.sh
diff options
context:
space:
mode:
authorGeliang Tang <geliang.tang@suse.com>2023-11-28 15:18:51 -0800
committerJakub Kicinski <kuba@kernel.org>2023-11-29 20:06:18 -0800
commite3b47e460b4bd0c61d0082f1ac02650dcb79e5d1 (patch)
tree4661b59da2b9a953c296728c1965d66ddbbb2723 /tools/testing/selftests/net/mptcp/mptcp_join.sh
parentb3ac570aae6b73eb810207583af0693adca30543 (diff)
selftests: mptcp: userspace pm remove initial subflow
This patch adds a selftest for userspace PM to remove the initial subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial IP address to userspace_pm_rm_sf() to remove the initial subflow. Reviewed-by: Matthieu Baerts <matttbe@kernel.org> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-7-8d6b94150f6b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/mptcp/mptcp_join.sh')
-rwxr-xr-xtools/testing/selftests/net/mptcp/mptcp_join.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 4357a46ca3f3..812a5ee54158 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3514,6 +3514,30 @@ userspace_tests()
kill_events_pids
wait $tests_pid
fi
+
+ # userspace pm remove initial subflow
+ if reset_with_events "userspace pm remove initial subflow" &&
+ continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
+ set_userspace_pm $ns2
+ pm_nl_set_limits $ns1 0 1
+ speed=5 \
+ run_tests $ns1 $ns2 10.0.1.1 &
+ local tests_pid=$!
+ wait_mpj $ns2
+ userspace_pm_add_sf $ns2 10.0.3.2 20
+ chk_join_nr 1 1 1
+ chk_mptcp_info subflows 1 subflows 1
+ chk_subflows_total 2 2
+ userspace_pm_rm_sf $ns2 10.0.1.2
+ # we don't look at the counter linked to the RM_ADDR but
+ # to the one linked to the subflows that have been removed
+ chk_rm_nr 0 1
+ chk_rst_nr 0 0 invert
+ chk_mptcp_info subflows 1 subflows 1
+ chk_subflows_total 1 1
+ kill_events_pids
+ wait $tests_pid
+ fi
}
endpoint_tests()