[PATCH mptcp-next 7/7] selftests: mptcp: add fullmesh setting tests

Geliang Tang posted 7 patches 4 months, 2 weeks ago
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>, "David S. Miller" <davem@davemloft.net>
[PATCH mptcp-next 7/7] selftests: mptcp: add fullmesh setting tests
Posted by Geliang Tang 4 months, 2 weeks ago
This patch added the fullmesh setting and clearing selftests in
mptcp_join.sh.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 7dbd36c558cd..8c4ee9092e83 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -473,6 +473,12 @@ do_transfer()
 				elif [ $setflags = "nobackup" ]; then
 					cmd=clear
 					flags=backup
+				elif [ $setflags = "fullmesh" ]; then
+					cmd=set
+					flags=fullmesh
+				elif [ $setflags = "nofullmesh" ]; then
+					cmd=clear
+					flags=fullmesh
 				fi
 				ip netns exec $netns ./pm_nl_ctl $cmd $addr flags $flags
 			fi
@@ -1927,6 +1933,24 @@ fullmesh_tests()
 	run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
 	chk_join_nr "fullmesh test 1x2, limited" 4 4 4
 	chk_add_nr 1 1
+
+	# fullmesh flag setting test
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 4 4
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags subflow
+	ip netns exec $ns2 ./pm_nl_ctl limits 4 4
+	run_tests $ns1 $ns2 10.0.1.1 0 0 1 slow fullmesh
+	chk_join_nr "fullmesh flag setting test" 2 2 2
+	chk_rm_nr 1 1
+
+	# fullmesh flag clearing test
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 4 4
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags subflow,fullmesh
+	ip netns exec $ns2 ./pm_nl_ctl limits 4 4
+	run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_1 slow nofullmesh
+	chk_join_nr "fullmesh flag clearing test" 2 2 2
+	chk_rm_nr 1 1
 }
 
 userspace_tests()
-- 
2.31.1