@@ -3510,6 +3510,52 @@ userspace_tests()
kill_events_pids
wait $tests_pid
fi
+
+ # userspace pm dump address
+ if reset_with_events "userspace pm dump address" &&
+ 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
+ local dump="id 10 flags signal 10.0.2.1"
+ [ $ip_mptcp -eq 1 ] && dump="10.0.2.1 id 10 signal "
+ mptcp_lib_check_output "pm_nl_show_endpoints $ns1" \
+ "$dump" " dump addrs signal"
+ kill_events_pids
+ wait $tests_pid
+ fi
+
+ # userspace pm dump subflow
+ if reset_with_events "userspace pm dump subflow" &&
+ continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
+ set_userspace_pm $ns2
+ pm_nl_set_limits $ns1 0 1
+ speed=5 \
+ run_tests $ns1 $ns2 10.0.1.1 &
+ local tests_pid=$!
+ wait_mpj $ns2
+ chk_mptcp_info subflows 0 subflows 0
+ chk_subflows_total 1 1
+ userspace_pm_add_sf $ns2 10.0.3.2 20
+ chk_join_nr 1 1 1
+ chk_mptcp_info subflows 1 subflows 1
+ chk_subflows_total 2 2
+ local dump="id 20 flags subflow 10.0.3.2"
+ [ $ip_mptcp -eq 1 ] && dump="10.0.3.2 id 20 subflow "
+ mptcp_lib_check_output "pm_nl_show_endpoints $ns2" \
+ "$dump" " dump addrs subflow"
+ kill_events_pids
+ wait $tests_pid
+ fi
}
endpoint_tests()
This patch tests newly added dump command for the userspace PM. Add two new tests for userspace pm dump address and subflow. Use the helpers userspace_pm_add_addr() and userspace_pm_add_sf() to add an address and a suflow, and use mptcp_lib_check_output() helper to check the outputs of dump commands. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- .../testing/selftests/net/mptcp/mptcp_join.sh | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+)