selftests: fib_tests: sleep after changing carrier. again. [Linux 5.0]

This Linux kernel change "selftests: fib_tests: sleep after changing carrier. again" is included in the Linux 5.0 release. This change is authored by Thadeu Lima de Souza Cascardo <cascardo [at]> on Fri Feb 22 07:27:41 2019 -0300. The commit for this change in Linux stable tree is af548a2 (patch).

selftests: fib_tests: sleep after changing carrier. again.

Just like commit e2ba732a1681 ("selftests: fib_tests: sleep after
changing carrier"), wait one second to allow linkwatch to propagate the
carrier change to the stack.

There are two sets of carrier tests. The first slept after the carrier
was set to off, and when the second set ran, it was likely that the
linkwatch would be able to run again without much delay, reducing the
likelihood of a race. However, if you run ' -t carrier' on a
loop, you will quickly notice the failures.

Sleeping on the second set of tests make the failures go away.

Cc: David Ahern <[email protected]>
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 tools/testing/selftests/net/ | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/net/ b/tools/testing/selftests/net/
index 802b4af..1080ff5 100755
--- a/tools/testing/selftests/net/
+++ b/tools/testing/selftests/net/
@@ -388,6 +388,7 @@ fib_carrier_unicast_test()

    set -e
    $IP link set dev dummy0 carrier off
+   sleep 1
    set +e

    echo "    Carrier down"

Leave a Reply

Your email address will not be published. Required fields are marked *