From: Paolo Abeni Date: Thu, 8 Feb 2024 17:57:49 +0000 (+0100) Subject: selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW X-Git-Tag: microblaze-v6.10~161^2~285 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=9c52994e32c5d8aaff13b1a13f7b35b988b02b26;p=linux-2.6-microblaze.git selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW This test is time sensitive. It may fail on virtual machines and for debug builds. Similar to commit c41dfb0dfbec ("selftests/net: ignore timing errors in so_txtime if KSFT_MACHINE_SLOW"), optionally suppress failure for timing errors (only). Signed-off-by: Paolo Abeni Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/txtimestamp.c b/tools/testing/selftests/net/txtimestamp.c index 10f2fde3686b..ec60a16c9307 100644 --- a/tools/testing/selftests/net/txtimestamp.c +++ b/tools/testing/selftests/net/txtimestamp.c @@ -163,7 +163,8 @@ static void validate_timestamp(struct timespec *cur, int min_delay) if (cur64 < start64 + min_delay || cur64 > start64 + max_delay) { fprintf(stderr, "ERROR: %" PRId64 " us expected between %d and %d\n", cur64 - start64, min_delay, max_delay); - test_failed = true; + if (!getenv("KSFT_MACHINE_SLOW")) + test_failed = true; } }