diff mbox series

[mptcp-next,v13,23/32] selftests: mptcp: flush userspace addrs list

Message ID 522effa606f2173fb6fa78755b44b7da75d61296.1701180969.git.geliang.tang@suse.com (mailing list archive)
State Superseded, archived
Headers show
Series userspace pm enhancements | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 42 lines checked
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅

Commit Message

Geliang Tang Nov. 28, 2023, 2:22 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index ce5b5b71e508..a2baae49a451 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3513,8 +3513,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()
 		[ $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"
+		pm_nl_flush_endpoint $ns1
+		mptcp_lib_check_output "pm_nl_show_endpoints $ns1" \
+				       "" "      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
@@ -3555,6 +3561,12 @@  userspace_tests()
 		[ $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"
+		pm_nl_flush_endpoint $ns2
+		mptcp_lib_check_output "pm_nl_show_endpoints $ns2" \
+				       "" "      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