Commit graph

16 commits

Author SHA1 Message Date
Vincenzo Maffione ee5804da11 netmap: fix unit tests
After ad874544d9, interface name
validation has been removed, resulting in two unit tests failures.
Drop the failing tests since they no longer apply.

Reported by:	markj
2023-12-29 07:46:46 +00:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Vincenzo Maffione e2a431a0ff netmap: fix copyin/copyout of nmreq options list
The previous code unsuccesfully attempted to report a precise error for
each option in the user list. Moreover, commit 253b2ec199 broke some
ctrl-api-test (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260547).

With this patch we bail out as soon as an unrecoverable error is detected and
we properly check for copy boundaries. EOPNOTSUPP no longer immediately
returns an error, so that any other option in the list may be examined
by the caller code and a precise report of the (un)supported options can
be returned to the user.

With this patch, all ctrl-api-test unit tests pass again.

PR:			260547
Submitted by:		giuseppe.lettieri@unipi.it
Reviewed by:		vmaffione
MFC after:		14 days
2023-03-21 23:23:18 +00:00
John Baldwin f4db390553 netmap tests: Reset ctx->nmctx to NULL in nmreq_parsing.
This avoids leaking a pointer to the on-stack test_nmctx which
triggers a -Wdangling-pointer warning from GCC.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37536
2022-12-04 16:29:25 -08:00
Vincenzo Maffione 36d6e65722 netmap: update unit tests with libnetmap tests 2021-04-02 14:39:30 +00:00
Vincenzo Maffione 45c67e8f6b netmap: several typo fixes
No functional changes intended.
2021-04-02 07:01:20 +00:00
Kyle Evans 7cc42f6d25 Do a sweep and remove most WARNS=6 settings
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.

Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
2020-10-01 01:10:51 +00:00
Vincenzo Maffione 4f6858e8a9 netmap: add test cases for multiple host rings
Extend the netmap unit tests with new test cases for the multiple-host-rings
feature introduced by r345269.

MFC after:	1 week
2019-04-13 12:50:47 +00:00
Enji Cooper c9c9de9366 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
2019-04-09 17:52:11 +00:00
Olivier Cochard 7d757b71bf Skip this test if if_tap module is not available
PR:		236842
Approved by:	asomers
MFC after:	1 month
Sponsored by:	Netflix
2019-03-28 16:17:33 +00:00
Vincenzo Maffione 5e874d26a2 netmap: update unit tests
Revision r345269 introduced changes that triggered a regression on netmap
unit tests (tests/sys/netmap/ctrl-api-test.c).
This change updates the unit tests to remove the regression.

Reported by:	lwhsu
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19639
2019-03-20 10:36:58 +00:00
Vincenzo Maffione 08f34ad9ed netmap: unit tests: fix issues found by coverity scan
Reported by:	asomers
MFC after:	1 week
Sponsored by:	Sunny Valley Networks
2019-01-03 16:47:05 +00:00
Vincenzo Maffione 5854d71854 netmap: fix warnings on unit tests
Fix some printf() format string warnings raised for ctrl-api-test.c
on some architectures.

MFC after:	1 week
Sponsored by:	Sunny Valley Networks
2018-12-31 12:07:17 +00:00
Vincenzo Maffione 2a8682a815 netmap: add suite of unit tests
Import the unit tests from upstream (https://github.com/luigirizzo/netmap
ba02539859d46d33), and make them ready for use with Kyua.
There are currently 38 regression tests, which test the kernel control ABI
exposed by netmap to userspace applications:

  1: test for port info get
  2-5: tests for basic port registration
  6-9: tests for VALE
  10-11: tests for getting netmap allocator info
  12-15: tests for netmap pipes
  16: test on polling mode
  17-18: tests on options
  19-27: tests for sync-kloop subsystem
  28-39: tests for null ports
  31-38: tests for the legacy NIOCREGIF registers

Reviewed by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D18490
2018-12-31 11:17:58 +00:00