Skip to content

Commit 04b57c9

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: join: stop transfer when check is done (part 2)
Since the "Fixes" commits mentioned below, the newly added "userspace pm" subtests of mptcp_join selftests are launching the whole transfer in the background, do the required checks, then wait for the end of transfer. There is no need to wait longer, especially because the checks at the end of the transfer are ignored (which is fine). This saves quite a few seconds on slow environments. While at it, use 'mptcp_lib_kill_wait()' helper everywhere, instead of on a specific one with 'kill_tests_wait()'. Fixes: b2e2248 ("selftests: mptcp: userspace pm create id 0 subflow") Fixes: e3b47e4 ("selftests: mptcp: userspace pm remove initial subflow") Fixes: b9fb176 ("selftests: mptcp: userspace pm send RM_ADDR for ID 0") Cc: [email protected] Reviewed-and-tested-by: Geliang Tang <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://lore.kernel.org/r/20240131-upstream-net-20240131-mptcp-ci-issues-v1-9-4c1c11e571ff@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 31ee4ad commit 04b57c9

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,6 @@ kill_events_pids()
643643
mptcp_lib_kill_wait $evts_ns2_pid
644644
}
645645

646-
kill_tests_wait()
647-
{
648-
#shellcheck disable=SC2046
649-
kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1)
650-
wait
651-
}
652-
653646
pm_nl_set_limits()
654647
{
655648
local ns=$1
@@ -3494,7 +3487,7 @@ userspace_tests()
34943487
chk_mptcp_info subflows 1 subflows 1
34953488
chk_subflows_total 2 2
34963489
kill_events_pids
3497-
wait $tests_pid
3490+
mptcp_lib_kill_wait $tests_pid
34983491
fi
34993492

35003493
# userspace pm remove initial subflow
@@ -3518,7 +3511,7 @@ userspace_tests()
35183511
chk_mptcp_info subflows 1 subflows 1
35193512
chk_subflows_total 1 1
35203513
kill_events_pids
3521-
wait $tests_pid
3514+
mptcp_lib_kill_wait $tests_pid
35223515
fi
35233516

35243517
# userspace pm send RM_ADDR for ID 0
@@ -3544,7 +3537,7 @@ userspace_tests()
35443537
chk_mptcp_info subflows 1 subflows 1
35453538
chk_subflows_total 1 1
35463539
kill_events_pids
3547-
wait $tests_pid
3540+
mptcp_lib_kill_wait $tests_pid
35483541
fi
35493542
}
35503543

@@ -3558,7 +3551,8 @@ endpoint_tests()
35583551
pm_nl_set_limits $ns2 2 2
35593552
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
35603553
speed=slow \
3561-
run_tests $ns1 $ns2 10.0.1.1 2>/dev/null &
3554+
run_tests $ns1 $ns2 10.0.1.1 &
3555+
local tests_pid=$!
35623556

35633557
wait_mpj $ns1
35643558
pm_nl_check_endpoint "creation" \
@@ -3573,7 +3567,7 @@ endpoint_tests()
35733567
pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
35743568
pm_nl_check_endpoint "modif is allowed" \
35753569
$ns2 10.0.2.2 id 1 flags signal
3576-
kill_tests_wait
3570+
mptcp_lib_kill_wait $tests_pid
35773571
fi
35783572

35793573
if reset "delete and re-add" &&
@@ -3582,7 +3576,8 @@ endpoint_tests()
35823576
pm_nl_set_limits $ns2 1 1
35833577
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
35843578
test_linkfail=4 speed=20 \
3585-
run_tests $ns1 $ns2 10.0.1.1 2>/dev/null &
3579+
run_tests $ns1 $ns2 10.0.1.1 &
3580+
local tests_pid=$!
35863581

35873582
wait_mpj $ns2
35883583
chk_subflow_nr "before delete" 2
@@ -3597,7 +3592,7 @@ endpoint_tests()
35973592
wait_mpj $ns2
35983593
chk_subflow_nr "after re-add" 2
35993594
chk_mptcp_info subflows 1 subflows 1
3600-
kill_tests_wait
3595+
mptcp_lib_kill_wait $tests_pid
36013596
fi
36023597
}
36033598

0 commit comments

Comments
 (0)