[PATCH RFC mptcp-next 4/4] selftests: mptcp: add round-robin testcase

Geliang Tang posted 4 patches 1 month, 2 weeks ago
Maintainers: Shuah Khan <shuah@kernel.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>, "David S. Miller" <davem@davemloft.net>, Matthieu Baerts <matthieu.baerts@tessares.net>, Jonathan Corbet <corbet@lwn.net>, Jakub Kicinski <kuba@kernel.org>

[PATCH RFC mptcp-next 4/4] selftests: mptcp: add round-robin testcase

Posted by Geliang Tang 1 month, 2 weeks ago
From: Geliang Tang <geliangtang@xiaomi.com>

Add the round-robin scheduler testcase.

Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 255793c5ac4f..c69b1dce95f7 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -15,6 +15,7 @@ timeout_test=$((timeout_poll * 2 + 1))
 mptcp_connect=""
 capture=0
 checksum=0
+roundrobin=0
 do_all_tests=1
 
 TEST_COUNT=0
@@ -55,6 +56,9 @@ init()
 		if [ $checksum -eq 1 ]; then
 			ip netns exec $netns sysctl -q net.mptcp.checksum_enabled=1
 		fi
+		if [ $roundrobin -eq 1 ]; then
+			ip netns exec $netns sysctl -q net.mptcp.scheduler="roundrobin"
+		fi
 	done
 
 	#  ns1              ns2
@@ -1854,9 +1858,12 @@ for arg in "$@"; do
 	if [[ "${arg}" =~ ^"-"[0-9a-zA-Z]*"C"[0-9a-zA-Z]*$ ]]; then
 		checksum=1
 	fi
+	if [[ "${arg}" =~ ^"-"[0-9a-zA-Z]*"R"[0-9a-zA-Z]*$ ]]; then
+		roundrobin=1
+	fi
 
-	# exception for the capture/checksum options, the rest means: a part of the tests
-	if [ "${arg}" != "-c" ] && [ "${arg}" != "-C" ]; then
+	# exception for the capture/checksum/roundrobin options, the rest means: a part of the tests
+	if [ "${arg}" != "-c" ] && [ "${arg}" != "-C" ] && [ "${arg}" != "-R" ]; then
 		do_all_tests=0
 	fi
 done
-- 
2.31.1