]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selftests: mptcp: stop tests earlier
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Tue, 7 Feb 2023 13:04:18 +0000 (14:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:51 +0000 (19:11 +0100)
commit 070d6dafacbaa9d1f2e4e3edc263853d194af15e upstream.

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: e274f7154008 ("selftests: mptcp: add subflow limits test-cases")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh

index 85d5535b3b728cb3cb9351c789b8835cd1eea840..76a197f7b8132ef1ad8864bbd9919d4be6e626cf 100755 (executable)
@@ -472,6 +472,12 @@ kill_wait()
        wait $1 2>/dev/null
 }
 
+kill_tests_wait()
+{
+       kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1)
+       wait
+}
+
 pm_nl_set_limits()
 {
        local ns=$1
@@ -2991,7 +2997,7 @@ endpoint_tests()
                pm_nl_set_limits $ns1 2 2
                pm_nl_set_limits $ns2 2 2
                pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
-               run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow &
+               run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow 2>/dev/null &
 
                wait_mpj $ns1
                pm_nl_check_endpoint 1 "creation" \
@@ -3004,14 +3010,14 @@ endpoint_tests()
                pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
                pm_nl_check_endpoint 0 "modif is allowed" \
                        $ns2 10.0.2.2 id 1 flags signal
-               wait
+               kill_tests_wait
        fi
 
        if reset "delete and re-add"; then
                pm_nl_set_limits $ns1 1 1
                pm_nl_set_limits $ns2 1 1
                pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
-               run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 &
+               run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 2>/dev/null &
 
                wait_mpj $ns2
                pm_nl_del_endpoint $ns2 2 10.0.2.2
@@ -3021,7 +3027,7 @@ endpoint_tests()
                pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow
                wait_mpj $ns2
                chk_subflow_nr "" "after re-add" 2
-               wait
+               kill_tests_wait
        fi
 }