]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: net: fib_nexthops: Wait before checking reported idle time
authorPetr Machata <petrm@nvidia.com>
Fri, 24 Sep 2021 10:04:27 +0000 (12:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Sep 2021 11:15:36 +0000 (12:15 +0100)
commit7092e39341c5436dd39f89a49a1c5a33933ce471
tree4947d99b91e7795f5890f1fbf174f1e1add3dd44
parent6bfc81c55c6d9a35295e071cb59d79a784c342c8
selftests: net: fib_nexthops: Wait before checking reported idle time

The purpose of this test is to verify that after a short activity passes,
the reported time is reasonable: not zero (which could be reported by
mistake), and not something outrageous (which would be indicative of an
issue in used units).

However, the idle time is reported in units of clock_t, or hundredths of
second. If the initial sequence of commands is very quick, it is possible
that the idle time is reported as just flat-out zero. When this test was
recently enabled in our nightly regression, we started seeing spurious
failures for exactly this reason.

Therefore buffer the delay leading up to the test with a sleep, to make
sure there is no legitimate way of reporting 0.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fib_nexthops.sh