Commit 68205b2a authored by Geliang Tang's avatar Geliang Tang Committed by Geliang Tang
Browse files

selftests: mptcp: userspace pm send RM_ADDR for ID 0

mainline inclusion
from mainline-v6.8-rc1
commit b9fb176081fb216c43d923888f0d53d9e3a5965b
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VYQ9
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b9fb176081fb216c43d923888f0d53d9e3a5965b



--------------------------------

This patch adds a selftest for userspace PM to remove id 0 address.

Use userspace_pm_add_addr() helper to add an id 10 address, then use
userspace_pm_rm_addr() helper to remove id 0 address.

Reviewed-by: default avatarMatthieu Baerts <matttbe@kernel.org>
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarMat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-8-8d6b94150f6b@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
parent dd587a10
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -3512,6 +3512,32 @@ userspace_tests()
		kill_events_pids
		wait $tests_pid
	fi

	# userspace pm send RM_ADDR for ID 0
	if reset_with_events "userspace pm send RM_ADDR for ID 0" &&
	   continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
		set_userspace_pm $ns1
		pm_nl_set_limits $ns2 1 1
		speed=5 \
			run_tests $ns1 $ns2 10.0.1.1 &
		local tests_pid=$!
		wait_mpj $ns1
		userspace_pm_add_addr $ns1 10.0.2.1 10
		chk_join_nr 1 1 1
		chk_add_nr 1 1
		chk_mptcp_info subflows 1 subflows 1
		chk_subflows_total 2 2
		chk_mptcp_info add_addr_signal 1 add_addr_accepted 1
		userspace_pm_rm_addr $ns1 0
		# we don't look at the counter linked to the subflows that
		# have been removed but to the one linked to the RM_ADDR
		chk_rm_nr 1 0 invert
		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()