Skip to content

Commit

Permalink
selftests: mptcp: join: skip userspace PM tests if not supported
Browse files Browse the repository at this point in the history
Selftests are supposed to run on any kernels, including the old ones not
supporting all MPTCP features.

One of them is the support of the userspace PM introduced by commit
4638de5 ("mptcp: handle local addrs announced by userspace PMs")
and the following ones.

It is possible to look for the MPTCP pm_type's sysctl knob to know in
advance if the userspace PM is available.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: 5ac1d2d ("selftests: mptcp: Add tests for userspace PM type")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Matthieu Baerts authored and Jakub Kicinski committed Jun 12, 2023
1 parent 9db34c4 commit f2b492b
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ init_partial()
ip netns add $netns || exit $ksft_skip
ip -net $netns link set lo up
ip netns exec $netns sysctl -q net.mptcp.enabled=1
ip netns exec $netns sysctl -q net.mptcp.pm_type=0
ip netns exec $netns sysctl -q net.mptcp.pm_type=0 2>/dev/null || true
ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0
ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=0
if [ $checksum -eq 1 ]; then
Expand Down Expand Up @@ -3191,7 +3191,8 @@ fail_tests()
userspace_tests()
{
# userspace pm type prevents add_addr
if reset "userspace pm type prevents add_addr"; then
if reset "userspace pm type prevents add_addr" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
pm_nl_set_limits $ns1 0 2
pm_nl_set_limits $ns2 0 2
Expand All @@ -3202,7 +3203,8 @@ userspace_tests()
fi

# userspace pm type does not echo add_addr without daemon
if reset "userspace pm no echo w/o daemon"; then
if reset "userspace pm no echo w/o daemon" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns2
pm_nl_set_limits $ns1 0 2
pm_nl_set_limits $ns2 0 2
Expand All @@ -3213,7 +3215,8 @@ userspace_tests()
fi

# userspace pm type rejects join
if reset "userspace pm type rejects join"; then
if reset "userspace pm type rejects join" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
pm_nl_set_limits $ns1 1 1
pm_nl_set_limits $ns2 1 1
Expand All @@ -3223,7 +3226,8 @@ userspace_tests()
fi

# userspace pm type does not send join
if reset "userspace pm type does not send join"; then
if reset "userspace pm type does not send join" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns2
pm_nl_set_limits $ns1 1 1
pm_nl_set_limits $ns2 1 1
Expand All @@ -3233,7 +3237,8 @@ userspace_tests()
fi

# userspace pm type prevents mp_prio
if reset "userspace pm type prevents mp_prio"; then
if reset "userspace pm type prevents mp_prio" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
pm_nl_set_limits $ns1 1 1
pm_nl_set_limits $ns2 1 1
Expand All @@ -3244,7 +3249,8 @@ userspace_tests()
fi

# userspace pm type prevents rm_addr
if reset "userspace pm type prevents rm_addr"; then
if reset "userspace pm type prevents rm_addr" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
set_userspace_pm $ns2
pm_nl_set_limits $ns1 0 1
Expand All @@ -3256,7 +3262,8 @@ userspace_tests()
fi

# userspace pm add & remove address
if reset_with_events "userspace pm add & remove address"; then
if reset_with_events "userspace pm add & remove address" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
pm_nl_set_limits $ns2 1 1
run_tests $ns1 $ns2 10.0.1.1 0 userspace_1 0 slow
Expand All @@ -3267,7 +3274,8 @@ userspace_tests()
fi

# userspace pm create destroy subflow
if reset_with_events "userspace pm create destroy subflow"; then
if reset_with_events "userspace pm create destroy 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
run_tests $ns1 $ns2 10.0.1.1 0 0 userspace_1 slow
Expand Down

0 comments on commit f2b492b

Please sign in to comment.