svn commit: r346061 - head/tests/sys/netmap

Enji Cooper ngie at FreeBSD.org
Tue Apr 9 17:52:12 UTC 2019


Author: ngie
Date: Tue Apr  9 17:52:11 2019
New Revision: 346061
URL: https://svnweb.freebsd.org/changeset/base/346061

Log:
  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
  Reviewed by:	vmaffione
  Approved by:	emaste (mentor)
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D19864

Modified:
  head/tests/sys/netmap/Makefile
  head/tests/sys/netmap/ctrl-api-test.c

Modified: head/tests/sys/netmap/Makefile
==============================================================================
--- head/tests/sys/netmap/Makefile	Tue Apr  9 17:23:34 2019	(r346060)
+++ head/tests/sys/netmap/Makefile	Tue Apr  9 17:52:11 2019	(r346061)
@@ -6,9 +6,10 @@ TESTSDIR=	${TESTSBASE}/sys/netmap
 TEST_METADATA+=	required_user="root"
 TEST_METADATA+=	is_exclusive=true
 
-LDFLAGS+= 	-lpthread
-CFLAGS+=	-I${SRCTOP}/tests
 PLAIN_TESTS_C+=	ctrl-api-test
+
+CFLAGS+=	-I${SRCTOP}/tests
+LIBADD+= 	pthread
 
 WARNS?=		6
 

Modified: head/tests/sys/netmap/ctrl-api-test.c
==============================================================================
--- head/tests/sys/netmap/ctrl-api-test.c	Tue Apr  9 17:23:34 2019	(r346060)
+++ head/tests/sys/netmap/ctrl-api-test.c	Tue Apr  9 17:52:11 2019	(r346061)
@@ -1839,6 +1839,7 @@ main(int argc, char **argv)
 
 #ifdef __FreeBSD__
 	PLAIN_REQUIRE_KERNEL_MODULE("if_tap", 0);
+	PLAIN_REQUIRE_KERNEL_MODULE("netmap", 0);
 #endif
 
 	memset(&ctx_, 0, sizeof(ctx_));


More information about the svn-src-head mailing list