]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbe9e0b0b0390d78645e57c75ec4b058ef0dc75a0
treef6146a6db4c69fb83c5be65fc0d5a992a26994b3
parentc0f877b9a1352ca8ecaa2242c5ccb23998d4cc02
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