aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/net
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2024-02-01 11:21:19 -0500
committerPaolo Abeni <pabeni@redhat.com>2024-02-06 10:19:06 +0100
commitc41dfb0dfbece824143ff51829d42cba4cb3c277 (patch)
tree03cb69bec24981daee7d9c100c8ad6feacf1d4f9 /tools/testing/selftests/net
parentnetdevsim: add Makefile for selftests (diff)
downloadwireguard-linux-c41dfb0dfbece824143ff51829d42cba4cb3c277.tar.xz
wireguard-linux-c41dfb0dfbece824143ff51829d42cba4cb3c277.zip
selftests/net: ignore timing errors in so_txtime if KSFT_MACHINE_SLOW
This test is time sensitive. It may fail on virtual machines and for debug builds. Continue to run in these environments to get code coverage. But optionally suppress failure for timing errors (only). This is controlled with environment variable KSFT_MACHINE_SLOW. The test continues to return 0 (KSFT_PASS), rather than KSFT_XFAIL as previously discussed. Because making so_txtime.c return that and then making so_txtime.sh capture runs that pass that vs KSFT_FAIL and pass it on added a bunch of (fragile bash) boilerplate, while the result is interpreted the same as KSFT_PASS anyway. Signed-off-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20240201162130.2278240-1-willemdebruijn.kernel@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/testing/selftests/net')
-rw-r--r--tools/testing/selftests/net/so_txtime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c
index 2672ac0b6d1f..8457b7ccbc09 100644
--- a/tools/testing/selftests/net/so_txtime.c
+++ b/tools/testing/selftests/net/so_txtime.c
@@ -134,8 +134,11 @@ static void do_recv_one(int fdr, struct timed_send *ts)
if (rbuf[0] != ts->data)
error(1, 0, "payload mismatch. expected %c", ts->data);
- if (llabs(tstop - texpect) > cfg_variance_us)
- error(1, 0, "exceeds variance (%d us)", cfg_variance_us);
+ if (llabs(tstop - texpect) > cfg_variance_us) {
+ fprintf(stderr, "exceeds variance (%d us)\n", cfg_variance_us);
+ if (!getenv("KSFT_MACHINE_SLOW"))
+ exit(1);
+ }
}
static void do_recv_verify_empty(int fdr)