]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: local_termination: Wait for interfaces to come up
authorAlexander Sverdlin <alexander.sverdlin@siemens.com>
Thu, 6 Nov 2025 16:12:09 +0000 (17:12 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Nov 2025 02:46:36 +0000 (18:46 -0800)
It seems that most of the tests prepare the interfaces once before the test
run (setup_prepare()), rely on setup_wait() to wait for link and only then
run the test(s).

local_termination brings the physical interfaces down and up during test
run but never wait for them to come up. If the auto-negotiation takes
some seconds, first test packets are being lost, which leads to
false-negative test results.

Use setup_wait() in run_test() to make sure auto-negotiation has been
completed after all simple_if_init() calls on physical interfaces and test
packets will not be lost because of the race against link establishment.

Fixes: 90b9566aa5cd3f ("selftests: forwarding: add a test for local_termination.sh")
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://patch.msgid.link/20251106161213.459501-1-alexander.sverdlin@siemens.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/local_termination.sh

index ecd34f364125cbafe788c6b071eed1a67ef960b4..892895659c7e4cca17c771f30df249ac68fbfa59 100755 (executable)
@@ -176,6 +176,8 @@ run_test()
        local rcv_dmac=$(mac_get $rcv_if_name)
        local should_receive
 
+       setup_wait
+
        tcpdump_start $rcv_if_name
 
        mc_route_prepare $send_if_name