selftests: forwarding: ethtool_extended_state: Convert to busywait
authorPetr Machata <petrm@nvidia.com>
Tue, 28 Jun 2022 10:37:44 +0000 (12:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2022 13:01:23 +0000 (14:01 +0100)
commit04cfbc1d89d4cc73b5b328e3bacf24d43e9aa4b7
treef6146a6db4c69fb83c5be65fc0d5a992a26994b3
parent9bacb93bcfb83ab0e939ce9185f8ba910fb6adb0
selftests: forwarding: ethtool_extended_state: Convert to busywait

Currently, this script sets up the test scenario, which is supposed to end
in an inability of the system to negotiate a link. It then waits for a bit,
and verifies that the system can diagnose why the link was not established.

The wait time for the scenario where different link speeds are forced on
the two ends of a loopback cable, was set to 4 seconds, which exactly
covered it. As of a recent mlxsw firmware update, this time gets longer,
and this test starts failing.

The time that selftests currently wait for links to be established is
currently $WAIT_TIMEOUT, or 20 seconds. It seems reasonable that if this is
the time necessary to establish and bring up a link, it should also be
enough to determine that a link cannot be established and why.

Therefore in this patch, convert the sleeps to busywaits, so that if a
failure is established sooner (as is expected), the test runs quicker. And
use $WAIT_TIMEOUT as the time to wait.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/ethtool_extended_state.sh