@@ -3514,8 +3514,8 @@ userspace_tests()
wait $tests_pid
fi
- # userspace pm dump address
- if reset_with_events "userspace pm dump address" &&
+ # userspace pm dump & flush address
+ if reset_with_events "userspace pm dump & flush 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
@@ -3532,12 +3532,18 @@ userspace_tests()
mptcp_lib_check "ip netns exec $ns1 ./pm_nl_ctl dump" \
"id 10 flags signal 10.0.2.1" \
" dump addrs signal"
+ ip netns exec $ns1 ./pm_nl_ctl flush
+ mptcp_lib_check "ip netns exec $ns1 ./pm_nl_ctl dump" \
+ "" " dump addrs after flush"
+ chk_rm_nr 1 1 invert
+ chk_mptcp_info subflows 0 subflows 0
+ chk_subflows_total 1 1
kill_events_pids
wait $tests_pid
fi
- # userspace pm dump subflow
- if reset_with_events "userspace pm dump subflow" &&
+ # userspace pm dump & flush subflow
+ if reset_with_events "userspace pm dump & flush 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
@@ -3554,6 +3560,12 @@ userspace_tests()
mptcp_lib_check "ip netns exec $ns2 ./pm_nl_ctl dump" \
"id 20 flags subflow 10.0.3.2" \
" dump addrs subflow"
+ ip netns exec $ns2 ./pm_nl_ctl flush
+ mptcp_lib_check "ip netns exec $ns2 ./pm_nl_ctl dump" \
+ "" " dump addrs after flush"
+ chk_rm_nr 1 1
+ chk_mptcp_info subflows 0 subflows 0
+ chk_subflows_total 1 1
kill_events_pids
wait $tests_pid
fi
This patch tests newly added flush command for the userspace PM. Add flush commands into userspace pm dump address and subflow tests. And use dump commands to check if the userspace pm local address list is empty after addresses flushing. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- .../testing/selftests/net/mptcp/mptcp_join.sh | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)