mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
selftests: mptcp: userspace pm get addr tests
[ Upstream commit4cc5cc7ca0
] This patch adds a new helper userspace_pm_get_addr() in mptcp_join.sh. In it, parse the token value from the output of 'pm_nl_ctl events', then pass it to pm_nl_ctl get_addr command. Use this helper in userspace pm dump tests. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of:e93681afcb
("selftests: mptcp: join: cannot rm sf if closed") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1b8af4ba00
commit
485bb1981a
|
@ -3454,6 +3454,18 @@ userspace_pm_dump()
|
||||||
ip netns exec $1 ./pm_nl_ctl dump token $tk
|
ip netns exec $1 ./pm_nl_ctl dump token $tk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $1: ns ; $2: id
|
||||||
|
userspace_pm_get_addr()
|
||||||
|
{
|
||||||
|
local evts=$evts_ns1
|
||||||
|
local tk
|
||||||
|
|
||||||
|
[ "$1" == "$ns2" ] && evts=$evts_ns2
|
||||||
|
tk=$(mptcp_lib_evts_get_info token "$evts")
|
||||||
|
|
||||||
|
ip netns exec $1 ./pm_nl_ctl get $2 token $tk
|
||||||
|
}
|
||||||
|
|
||||||
userspace_pm_chk_dump_addr()
|
userspace_pm_chk_dump_addr()
|
||||||
{
|
{
|
||||||
local ns="${1}"
|
local ns="${1}"
|
||||||
|
@ -3469,6 +3481,21 @@ userspace_pm_chk_dump_addr()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userspace_pm_chk_get_addr()
|
||||||
|
{
|
||||||
|
local ns="${1}"
|
||||||
|
local id="${2}"
|
||||||
|
local exp="${3}"
|
||||||
|
|
||||||
|
print_check "get id ${id} addr"
|
||||||
|
|
||||||
|
if mptcp_lib_kallsyms_has "mptcp_userspace_pm_get_addr$"; then
|
||||||
|
check_output "userspace_pm_get_addr ${ns} ${id}" "${exp}"
|
||||||
|
else
|
||||||
|
print_skip
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
userspace_tests()
|
userspace_tests()
|
||||||
{
|
{
|
||||||
# userspace pm type prevents add_addr
|
# userspace pm type prevents add_addr
|
||||||
|
@ -3563,6 +3590,8 @@ userspace_tests()
|
||||||
userspace_pm_chk_dump_addr "${ns1}" \
|
userspace_pm_chk_dump_addr "${ns1}" \
|
||||||
$'id 10 flags signal 10.0.2.1\nid 20 flags signal 10.0.3.1' \
|
$'id 10 flags signal 10.0.2.1\nid 20 flags signal 10.0.3.1' \
|
||||||
"signal"
|
"signal"
|
||||||
|
userspace_pm_chk_get_addr "${ns1}" "10" "id 10 flags signal 10.0.2.1"
|
||||||
|
userspace_pm_chk_get_addr "${ns1}" "20" "id 20 flags signal 10.0.3.1"
|
||||||
userspace_pm_rm_addr $ns1 10
|
userspace_pm_rm_addr $ns1 10
|
||||||
userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED
|
userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED
|
||||||
userspace_pm_chk_dump_addr "${ns1}" \
|
userspace_pm_chk_dump_addr "${ns1}" \
|
||||||
|
@ -3593,6 +3622,7 @@ userspace_tests()
|
||||||
userspace_pm_chk_dump_addr "${ns2}" \
|
userspace_pm_chk_dump_addr "${ns2}" \
|
||||||
"id 20 flags subflow 10.0.3.2" \
|
"id 20 flags subflow 10.0.3.2" \
|
||||||
"subflow"
|
"subflow"
|
||||||
|
userspace_pm_chk_get_addr "${ns2}" "20" "id 20 flags subflow 10.0.3.2"
|
||||||
userspace_pm_rm_addr $ns2 20
|
userspace_pm_rm_addr $ns2 20
|
||||||
userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED
|
userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED
|
||||||
userspace_pm_chk_dump_addr "${ns2}" \
|
userspace_pm_chk_dump_addr "${ns2}" \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user