Skip to content

Commit 070d6da

Browse files
matttbedavem330
authored andcommitted
selftests: mptcp: stop tests earlier
These 'endpoint' tests from 'mptcp_join.sh' selftest start a transfer in the background and check the status during this transfer. Once the expected events have been recorded, there is no reason to wait for the data transfer to finish. It can be stopped earlier to reduce the execution time by more than half. For these tests, the exchanged data were not verified. Errors, if any, were ignored but that's fine, plenty of other tests are looking at that. It is then OK to mute stderr now that we are sure errors will be printed (and still ignored) because the transfer is stopped before the end. Fixes: e274f71 ("selftests: mptcp: add subflow limits test-cases") Cc: [email protected] Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a635a8c commit 070d6da

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,12 @@ kill_events_pids()
498498
kill_wait $evts_ns2_pid
499499
}
500500

501+
kill_tests_wait()
502+
{
503+
kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1)
504+
wait
505+
}
506+
501507
pm_nl_set_limits()
502508
{
503509
local ns=$1
@@ -3055,7 +3061,7 @@ endpoint_tests()
30553061
pm_nl_set_limits $ns1 2 2
30563062
pm_nl_set_limits $ns2 2 2
30573063
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
3058-
run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow &
3064+
run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow 2>/dev/null &
30593065

30603066
wait_mpj $ns1
30613067
pm_nl_check_endpoint 1 "creation" \
@@ -3068,14 +3074,14 @@ endpoint_tests()
30683074
pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
30693075
pm_nl_check_endpoint 0 "modif is allowed" \
30703076
$ns2 10.0.2.2 id 1 flags signal
3071-
wait
3077+
kill_tests_wait
30723078
fi
30733079

30743080
if reset "delete and re-add"; then
30753081
pm_nl_set_limits $ns1 1 1
30763082
pm_nl_set_limits $ns2 1 1
30773083
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
3078-
run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 &
3084+
run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 2>/dev/null &
30793085

30803086
wait_mpj $ns2
30813087
pm_nl_del_endpoint $ns2 2 10.0.2.2
@@ -3085,7 +3091,7 @@ endpoint_tests()
30853091
pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow
30863092
wait_mpj $ns2
30873093
chk_subflow_nr "" "after re-add" 2
3088-
wait
3094+
kill_tests_wait
30893095
fi
30903096
}
30913097

0 commit comments

Comments
 (0)