This patch adds two new tests for userspace pm dump address and subflow.
Use userspace_pm_add_addr() and userspace_pm_add_sf() to add an address
and a suflow.
Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 44 +++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index a92fb5469621..cec4bfc5193b 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3593,6 +3593,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
+ local dump="id 10 flags signal 10.0.2.1"
+ check_output "userspace_pm_dump $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"
+ check_output "userspace_pm_dump $ns2" \
+ "$dump" " dump addrs subflow"
+ kill_events_pids
+ wait $tests_pid
+ fi
}
endpoint_tests()
--
2.39.2