Commit 11b64a46 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'mptcp-selftests-fix-timeouts-and-test-isolation'

Mat Martineau says:

====================
mptcp: selftests: Fix timeouts and test isolation

Patches 1 and 3 adjust test timeouts to reduce false negatives on slow
machines.

Patch 2 improves test isolation by running the mptcp_sockopt test in its
own net namespace.
====================

Link: https://lore.kernel.org/r/20221115221046.20370-1-mathew.j.martineau@linux.intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 847ccab8 3de88b95
...@@ -2152,7 +2152,7 @@ remove_tests() ...@@ -2152,7 +2152,7 @@ remove_tests()
pm_nl_set_limits $ns2 1 3 pm_nl_set_limits $ns2 1 3
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 -1 -2 slow run_tests $ns1 $ns2 10.0.1.1 0 -1 -2 speed_10
chk_join_nr 3 3 3 chk_join_nr 3 3 3
chk_add_nr 1 1 chk_add_nr 1 1
chk_rm_nr 2 2 chk_rm_nr 2 2
...@@ -2165,7 +2165,7 @@ remove_tests() ...@@ -2165,7 +2165,7 @@ remove_tests()
pm_nl_add_endpoint $ns1 10.0.3.1 flags signal pm_nl_add_endpoint $ns1 10.0.3.1 flags signal
pm_nl_add_endpoint $ns1 10.0.4.1 flags signal pm_nl_add_endpoint $ns1 10.0.4.1 flags signal
pm_nl_set_limits $ns2 3 3 pm_nl_set_limits $ns2 3 3
run_tests $ns1 $ns2 10.0.1.1 0 -3 0 slow run_tests $ns1 $ns2 10.0.1.1 0 -3 0 speed_10
chk_join_nr 3 3 3 chk_join_nr 3 3 3
chk_add_nr 3 3 chk_add_nr 3 3
chk_rm_nr 3 3 invert chk_rm_nr 3 3 invert
...@@ -2178,7 +2178,7 @@ remove_tests() ...@@ -2178,7 +2178,7 @@ remove_tests()
pm_nl_add_endpoint $ns1 10.0.3.1 flags signal pm_nl_add_endpoint $ns1 10.0.3.1 flags signal
pm_nl_add_endpoint $ns1 10.0.14.1 flags signal pm_nl_add_endpoint $ns1 10.0.14.1 flags signal
pm_nl_set_limits $ns2 3 3 pm_nl_set_limits $ns2 3 3
run_tests $ns1 $ns2 10.0.1.1 0 -3 0 slow run_tests $ns1 $ns2 10.0.1.1 0 -3 0 speed_10
chk_join_nr 1 1 1 chk_join_nr 1 1 1
chk_add_nr 3 3 chk_add_nr 3 3
chk_rm_nr 3 1 invert chk_rm_nr 3 1 invert
......
...@@ -35,8 +35,9 @@ init() ...@@ -35,8 +35,9 @@ init()
ns1="ns1-$rndh" ns1="ns1-$rndh"
ns2="ns2-$rndh" ns2="ns2-$rndh"
ns_sbox="ns_sbox-$rndh"
for netns in "$ns1" "$ns2";do for netns in "$ns1" "$ns2" "$ns_sbox";do
ip netns add $netns || exit $ksft_skip ip netns add $netns || exit $ksft_skip
ip -net $netns link set lo up ip -net $netns link set lo up
ip netns exec $netns sysctl -q net.mptcp.enabled=1 ip netns exec $netns sysctl -q net.mptcp.enabled=1
...@@ -73,7 +74,7 @@ init() ...@@ -73,7 +74,7 @@ init()
cleanup() cleanup()
{ {
for netns in "$ns1" "$ns2"; do for netns in "$ns1" "$ns2" "$ns_sbox"; do
ip netns del $netns ip netns del $netns
done done
rm -f "$cin" "$cout" rm -f "$cin" "$cout"
...@@ -243,7 +244,7 @@ do_mptcp_sockopt_tests() ...@@ -243,7 +244,7 @@ do_mptcp_sockopt_tests()
{ {
local lret=0 local lret=0
./mptcp_sockopt ip netns exec "$ns_sbox" ./mptcp_sockopt
lret=$? lret=$?
if [ $lret -ne 0 ]; then if [ $lret -ne 0 ]; then
...@@ -252,7 +253,7 @@ do_mptcp_sockopt_tests() ...@@ -252,7 +253,7 @@ do_mptcp_sockopt_tests()
return return
fi fi
./mptcp_sockopt -6 ip netns exec "$ns_sbox" ./mptcp_sockopt -6
lret=$? lret=$?
if [ $lret -ne 0 ]; then if [ $lret -ne 0 ]; then
......
...@@ -247,9 +247,10 @@ run_test() ...@@ -247,9 +247,10 @@ run_test()
tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1 tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1
tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2 tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2
# time is measured in ms, account for transfer size, affegated link speed # time is measured in ms, account for transfer size, aggregated link speed
# and header overhead (10%) # and header overhead (10%)
local time=$((size * 8 * 1000 * 10 / (( $rate1 + $rate2) * 1024 *1024 * 9) )) # ms byte -> bit 10% mbit -> kbit -> bit 10%
local time=$((1000 * size * 8 * 10 / ((rate1 + rate2) * 1000 * 1000 * 9) ))
# mptcp_connect will do some sleeps to allow the mp_join handshake # mptcp_connect will do some sleeps to allow the mp_join handshake
# completion (see mptcp_connect): 200ms on each side, add some slack # completion (see mptcp_connect): 200ms on each side, add some slack
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment