Skip to content

Commit

Permalink
selftests: mptcp: add userspace pm fullmesh tests
Browse files Browse the repository at this point in the history
This patch adds fullmesh selftests for userspace pm both on server side
and on client side. For the server side test, add two endpoints with
fullmesh flag on ns2, then signal an address on ns1 by userspace PM to
trigger the fullmesh connections. For the client side test, just use
userspace PM to create multiple subflows to do the fullmesh connections.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang authored and geliangtang committed Mar 13, 2024
1 parent 3d3b71b commit ebdf4a0
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3515,6 +3515,48 @@ userspace_tests()
kill_events_pids
mptcp_lib_kill_wait $tests_pid
fi

# userspace pm server fullmesh
if reset_with_events "userspace pm server fullmesh" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
set_userspace_pm $ns1
mptcp_lib_endpoint_ops limits $ns2 5 5
mptcp_lib_endpoint_ops add $ns2 10.0.2.2 flags subflow,fullmesh
mptcp_lib_endpoint_ops add $ns2 10.0.3.2 flags subflow,fullmesh
speed=10 \
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 4 4 4
chk_add_nr 1 1
chk_mptcp_info subflows 4 subflows 4
chk_subflows_total 5 5
chk_mptcp_info add_addr_signal 1 add_addr_accepted 1
show_mptcp_info last_data_sent last_data_recv last_ack_recv
kill_events_pids
mptcp_lib_kill_wait $tests_pid
fi

# userspace pm client fullmesh
if reset_with_events "userspace pm client fullmesh" &&
continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
mptcp_lib_endpoint_ops limits $ns1 5 5
set_userspace_pm $ns2
speed=10 \
run_tests $ns1 $ns2 10.0.1.1 &
local tests_pid=$!
wait_mpj $ns1
userspace_pm_add_sf $ns2 10.0.2.2 20
userspace_pm_add_sf $ns2 10.0.3.2 30
userspace_pm_add_sf $ns2 10.0.4.2 40
chk_join_nr 3 3 3
chk_mptcp_info subflows 3 subflows 3
chk_subflows_total 4 4
show_mptcp_info last_data_sent last_data_recv last_ack_recv
kill_events_pids
mptcp_lib_kill_wait $tests_pid
fi
}

endpoint_tests()
Expand Down

0 comments on commit ebdf4a0

Please sign in to comment.