diff mbox series

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

Message ID 7e749e6d27fee702dfc1c6478cb426c36e84a3ac.1631011068.git.geliangtang@xiaomi.com (mailing list archive)
State RFC, archived
Headers show
Series round-robin packet scheduler support | expand

Commit Message

Geliang Tang Sept. 7, 2021, 10:41 a.m. UTC
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 mbox series

Patch

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