Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2019 01:03:32 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r346256 - stable/11/tests/sys/netmap
Message-ID:  <201904160103.x3G13WBo015302@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Tue Apr 16 01:03:32 2019
New Revision: 346256
URL: https://svnweb.freebsd.org/changeset/base/346256

Log:
  MFC r345644,r346061:
  
  r345644 (by olivier):
  
  Skip this test if if_tap module is not available
  
  PR:		236842
  
  r346061:
  
  Polish netmap(4) testcases a bit
  
  1. Not all kernels have netmap(4) support. Check for netmap(4) support before
     attempting to run the tests via the `PLAIN_REQUIRE_KERNEL_MODULE(..)` macro.
  2. Libraries shouldn't be added to LDFLAGS; they should be added to LIBADD
     instead. This allows the build system to evaluate dependencies for sanity.
  3. Sort some of the Makefile variables per bsd.README.
  
  1., in particular, will resolve failures when running this testcase on kernels
  lacking netmap(4) support, e.g., the i386 GENERIC kernels on ^/stable/11 and
  ^/stable/12.
  
  PR:		237129

Modified:
  stable/11/tests/sys/netmap/Makefile
  stable/11/tests/sys/netmap/ctrl-api-test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/netmap/Makefile
==============================================================================
--- stable/11/tests/sys/netmap/Makefile	Tue Apr 16 00:41:22 2019	(r346255)
+++ stable/11/tests/sys/netmap/Makefile	Tue Apr 16 01:03:32 2019	(r346256)
@@ -6,8 +6,10 @@ TESTSDIR=	${TESTSBASE}/sys/netmap
 TEST_METADATA+=	required_user="root"
 TEST_METADATA+=	is_exclusive=true
 
-LDFLAGS+= 	-lpthread
 PLAIN_TESTS_C+=	ctrl-api-test
+
+CFLAGS+=	-I${SRCTOP}/tests
+LIBADD+= 	pthread
 
 WARNS?=		6
 

Modified: stable/11/tests/sys/netmap/ctrl-api-test.c
==============================================================================
--- stable/11/tests/sys/netmap/ctrl-api-test.c	Tue Apr 16 00:41:22 2019	(r346255)
+++ stable/11/tests/sys/netmap/ctrl-api-test.c	Tue Apr 16 01:03:32 2019	(r346256)
@@ -48,9 +48,15 @@
 #include <unistd.h>
 #include <signal.h>
 
+#ifdef __FreeBSD__
+#include "freebsd_test_suite/macros.h"
+#endif
+
+
 #ifdef __linux__
 #include <sys/eventfd.h>
 #else
+
 static int
 eventfd(int x __unused, int y __unused)
 {
@@ -1784,6 +1790,11 @@ main(int argc, char **argv)
 	int list = 0;
 	int opt;
 	int i;
+
+#ifdef __FreeBSD__
+	PLAIN_REQUIRE_KERNEL_MODULE("if_tap", 0);
+	PLAIN_REQUIRE_KERNEL_MODULE("netmap", 0);
+#endif
 
 	memset(&ctx_, 0, sizeof(ctx_));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904160103.x3G13WBo015302>