Skip to content

Commit

Permalink
selftests: mptcp: userspace pm get addr tests
Browse files Browse the repository at this point in the history
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 & flush tests.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Dec 11, 2023
1 parent 46a6f28 commit dc2dc30
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,18 @@ userspace_pm_rm_sf()
wait_rm_sf $1 "${cnt}"
}

# $1: ns ; $2: id
userspace_pm_get_addr()
{
local evts=$server_evts
local tk

[ "$1" == "$ns2" ] && evts=$client_evts
tk=$(mptcp_lib_evts_get_info token "$evts")

ip netns exec $1 ./pm_nl_ctl get $2 token $tk
}

check_output() {
: "${check_output_err:?}"
: "${ret:?}"
Expand Down Expand Up @@ -3556,6 +3568,8 @@ userspace_tests()
chk_subflows_total 2 2
chk_mptcp_info add_addr_signal 1 add_addr_accepted 1
local dump="id 10 flags signal 10.0.2.1"
mptcp_lib_check_output "userspace_pm_get_addr $ns1 10" \
"$dump" " get id 10 addr"
[ $ip_mptcp -eq 1 ] && dump="10.0.2.1 id 10 signal "
check_output "pm_nl_show_endpoints $ns1" \
"$dump" " dump addrs signal"
Expand All @@ -3579,6 +3593,8 @@ userspace_tests()
chk_mptcp_info subflows 1 subflows 1
chk_subflows_total 2 2
local dump="id 20 flags subflow 10.0.3.2"
mptcp_lib_check_output "userspace_pm_get_addr $ns2 20" \
"$dump" " get id 20 addr"
[ $ip_mptcp -eq 1 ] && dump="10.0.3.2 id 20 subflow "
check_output "pm_nl_show_endpoints $ns2" \
"$dump" " dump addrs subflow"
Expand Down

0 comments on commit dc2dc30

Please sign in to comment.