From 7d757b71bfe891ed892aedaaf0d39cef2c95422f Mon Sep 17 00:00:00 2001 From: Olivier Cochard Date: Thu, 28 Mar 2019 16:17:33 +0000 Subject: [PATCH] Skip this test if if_tap module is not available PR: 236842 Approved by: asomers MFC after: 1 month Sponsored by: Netflix --- tests/sys/netmap/Makefile | 1 + tests/sys/netmap/ctrl-api-test.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/tests/sys/netmap/Makefile b/tests/sys/netmap/Makefile index 542a21c46930..381bc4aa5ffe 100644 --- a/tests/sys/netmap/Makefile +++ b/tests/sys/netmap/Makefile @@ -7,6 +7,7 @@ TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive=true LDFLAGS+= -lpthread +CFLAGS+= -I${SRCTOP}/tests PLAIN_TESTS_C+= ctrl-api-test WARNS?= 6 diff --git a/tests/sys/netmap/ctrl-api-test.c b/tests/sys/netmap/ctrl-api-test.c index fac6595e0cc8..68f745b3d958 100644 --- a/tests/sys/netmap/ctrl-api-test.c +++ b/tests/sys/netmap/ctrl-api-test.c @@ -48,9 +48,15 @@ #include #include +#ifdef __FreeBSD__ +#include "freebsd_test_suite/macros.h" +#endif + + #ifdef __linux__ #include #else + static int eventfd(int x __unused, int y __unused) { @@ -1831,6 +1837,10 @@ main(int argc, char **argv) int opt; int i; +#ifdef __FreeBSD__ + PLAIN_REQUIRE_KERNEL_MODULE("if_tap", 0); +#endif + memset(&ctx_, 0, sizeof(ctx_)); {