From 282f8d4e42ad3a5bf1fba7d1780e2b22e9a7e876 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Thu, 1 Aug 2024 17:21:42 +0800 Subject: [PATCH] selftests: mptcp: join: add io thread tests This io thread mode is used in BPF selftests bpf_tcp_ca and MPTCP, and it is not very stable for MPTCP sched tests. This patch adds them into mptcp_join tests (-T) to make sure this scene is also covered. These tests only run in ns1 for 100 times. The failed output looks like: 001 io thread tests recv 2884500 expected 10485760 send 8005500 expected 10485760 Failed in thread_ret -11 Test no. 12 failed. syn [FAIL] got 12 JOIN[s] syn expected 100 synack [ OK ] ack [FAIL] got 12 JOIN[s] ack expected 100 Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 01c1e0871aca42..ecba07aac776a8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3663,6 +3663,24 @@ endpoint_tests() fi } +io_thread_tests() +{ + if reset "io thread tests"; then + local nr=0 max=100 + mptcp_lib_pm_nl_set_limits $ns1 8 8 + mptcp_lib_pm_nl_add_endpoint $ns1 10.0.2.1 flags subflow + while [ $nr -lt $max ]; do + nr=$((nr + 1)) + ip netns exec $ns1 ./mptcp_connect -l 10.0.1.1 -m "thread" -O 3000 + if [ $? -ne 0 ]; then + echo "Test no. $nr failed." + break; + fi + done + chk_join_nr $max 0 $max + fi +} + # [$1: error message] usage() { @@ -3711,6 +3729,7 @@ all_tests_sorted=( F@fail_tests u@userspace_tests I@endpoint_tests + T@io_thread_tests ) all_tests_args=""