]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW
authorPaolo Abeni <pabeni@redhat.com>
Thu, 8 Feb 2024 17:57:49 +0000 (18:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2024 10:21:15 +0000 (10:21 +0000)
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 <pabeni@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/txtimestamp.c

index 10f2fde3686be4abef8093594b809ef51e4334c1..ec60a16c93074ec78eb0bdf3d67c7a074a2d85fa 100644 (file)
@@ -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;
        }
 }