Hi Geliang,
On 04/03/2025 12:40, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> This patch adds a new helper set_path_manager() to set the newly added
> net.mptcp.path_manager, and test it inside a userspace pm test.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 13a3b68181ee..fa1929ca6ad4 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -3572,6 +3572,21 @@ userspace_tests()
> 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
> + if continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/path_manager'; then
You cannot have a "continue_if" here, that will mark the whole subtest
as skip if the condition is not met, then continue.
Why not having this in userspace_pm.sh as I suggested. It feels wrong to
have it here, in the "join" test, no?
https://lore.kernel.org/c49517d2-38e2-4848-9fb9-1c7748689cec@kernel.org
So in userspace_pm.sh, around "mptcp_lib_ns_init ns1 ns2", having
something like (not tested):
print_title "Init"
print_test "Created network namespaces ns1, ns2"
mptcp_lib_ns_init ns1 ns2
# check path_manager and pm_type sysctl mapping
if [ -f /proc/sys/net/mptcp/path_manager ]; then
ip netns exec "$ns1" sysctl -q net.mptcp.path_manager=userspace
pm_type="$(ip netns exec "$ns1" sysctl -n net.mptcp.pm_type)"
if [ "${pm_type}" != "1" ]; then
test_fail "unexpected pm_type: ${pm_type}"
mptcp_lib_result_print_all_tap
exit ${KSFT_FAIL}
fi
ip netns exec "$ns1" sysctl -q net.mptcp.pm_type=0
pm="$(ip netns exec "$ns1" sysctl -n net.mptcp.path_manager)"
if [ "${pm}" != "kernel" ]; then
test_fail "unexpected path-manager: ${pm}"
mptcp_lib_result_print_all_tap
exit ${KSFT_FAIL}
fi
fi
for i in "$ns1" "$ns2" ;do
ip netns exec "$i" sysctl -q net.mptcp.pm_type=1
done
(...)
WDYT?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.