@@ -3511,6 +3511,50 @@ 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
+ mptcp_lib_check "ip netns exec $ns1 ./pm_nl_ctl dump" \
+ "id 10 flags signal 10.0.2.1" \
+ " 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
+ mptcp_lib_check "ip netns exec $ns2 ./pm_nl_ctl dump" \
+ "id 20 flags subflow 10.0.3.2" \
+ " 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() helper to check the outputs of dump commands. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- .../testing/selftests/net/mptcp/mptcp_join.sh | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+)