aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* ng_ksocket: Add tests for IPv6Seyed Pouria Mousavizadeh Tehrani2025-06-251-12/+74
| | | | | | Add udp6_connect and udp6_bind for ng_ksocket Differential Revision: https://reviews.freebsd.org/D50111
* netgraph/ksocket tests: Bind to a specific addressMark Johnston2025-06-201-6/+9
| | | | | | | | | Otherwise we rely on connect(INADDR_ANY) connecting to a socket bound to an arbitrary host address, but as of commit cd240957d7ba this is disallowed by default. Reported by: Siva Mahadevan <me@svmhdvn.name> Fixes: cd240957d7ba ("netinet: Disallow connections to INADDR_ANY")
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* tests/netgraph: start ng_ksocket(4) testsGleb Smirnoff2024-03-232-0/+116
| | | | | | The ng_ksocket(4) functionality is very fragile as it interfaces with kernel socket code in unusual way. It definitely needs a test suite. Start one with a test that tests UDP over IPv4.
* tests/netgraph: mark all tests as required_user="root"Gleb Smirnoff2024-03-231-1/+1
| | | | | | | | Any netgraph operation requires root priveleges. Some tests in the directory already mark themselves with 'atf_tc_set_md_var(conf, "require.user", "root");' which creates a lot of pasted code. Some tests don't mark self. For this particular directory a blanket metadata setting in the Makefile is acceptable, imho.
* ng_socket: with getsockname() return node ID for unnamed nodeGleb Smirnoff2023-11-281-4/+3
| | | | | Reviewed by: afedorov Differential Revision: https://reviews.freebsd.org/D42691
* netgraph: increase size of sockaddr_ng to match maximum node nameGleb Smirnoff2023-11-281-5/+0
| | | | | | | | | | | The ng_socket(4) node already writes more than declared size of the struct at least in the in ng_getsockaddr(). Make size match size of a node name. The value is pasted instead of including ng_message.h into ng_socket.h. This is external API and we want to keep it stable even if NG_NODESIZ is redefined in a kernel build. Reviewed by: afedorov Differential Revision: https://reviews.freebsd.org/D42690
* tests/netgraph: start ng_socket test suiteGleb Smirnoff2023-11-202-0/+71
| | | | Just one check now, check node name.
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* netgraph tests: SerializeMark Johnston2023-03-181-0/+2
| | | | | | | Some tests share names for netgraph nodes, so they cannot be run in parallel. MFC after: 1 week
* Remove riscv workaround in sys.netgraph.hub.loop testMitchell Horne2021-12-051-5/+0
| | | | | | | | The test case now passes on this architecture. This reverts commits d5fd5cdc0638 and 168b579a4884. Reviewed by: lwhsu, imp Differential Revision: https://reviews.freebsd.org/D33252
* Fix RISC-V buildLi-Wen Hsu2021-10-141-1/+1
| | | | Fixes: d5fd5cdc063
* Temporarily skip sys.netgraph.hub.loop on RISC-V in CILi-Wen Hsu2021-10-131-0/+5
| | | | | | | This case panics kernel. PR: 259157 Sponsored by: The FreeBSD Foundation
* tests/netgraph: Check for PR241954Lutz Donnerhacke2021-06-131-0/+7
| | | | | | | | Add tests to check for renaming issues reported in PR241954 and solved in D30110. MFC: Together with D30629 Differential Revision: https://reviews.freebsd.org/D30713
* tests/netgraph: Missed fixup after D30699Lutz Donnerhacke2021-06-131-36/+23
| | | | | | | | During D30699 the existing basic tests were missed. Furthermore debugging output was still in the code, which is removed now. MFC: together with D30699 Differential Revision: https://reviews.freebsd.org/D30714
* tests/netgraph: Tests for ng_vlan_rotateLutz Donnerhacke2021-06-092-3/+340
| | | | | | | | | | | | Test functionality of ng_vlan_rotate(4): - Rotate 1 to 9 stagged vlans in any possible direction and length - Rotate random combinations of ethertypes (8100, 88a8, 9100) - Automatic reverse rotating for backward data flow - Test too many and to few vlans Reviewed by: kp (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30670
* tests/netgraph: Tests for ng_hubLutz Donnerhacke2021-06-092-0/+233
| | | | | | | | | | | | Test functionality of ng_hub(4): - replicting traffic to anything but the sending hook - persistence - an unrestricted loop - implementation limits with many hooks. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30633
* tests/netgraph: Factor out univeral data counter functionsLutz Donnerhacke2021-06-093-63/+78
| | | | | | | | Factor out the data counter helpers for other tests to use. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30699
* tests/netgraph: Fix styleLutz Donnerhacke2021-06-093-81/+105
| | | | | | | Indent all files correctly MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30692
* tests/netgraph: Attribute errors to the callerLutz Donnerhacke2021-06-082-27/+64
| | | | | | | | | Errors raised in the common util functions should raise the location of their caller to be useful and include the errno description. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30671
* tests/netgraph: Tests for ng_bridgeLutz Donnerhacke2021-06-082-0/+656
| | | | | | | | | | | | | Test functionality of ng_bridge(4): - replicating traffic to anything but the sending hook - persistence - detect loops - unicast to only one link of many - stretch to implementation limits on broadcast Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30647
* tests/netgraph: Allow receiving answers to messagesLutz Donnerhacke2021-06-082-5/+14
| | | | | | | | | Add msg_handler in order to receive messages from netgraph nodes to be tested. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30657
* tests/netgraph: Inital framework for testing libnetgraphLutz Donnerhacke2021-06-044-1/+486
| | | | | | | | | | | | | | Provide a framework of functions to test various netgraph modules. Tests contain: - creating, renaming, and destroying nodes - connecting and removing hooks - sending and receiving data - sending ASCII messages - errors can be passed for indiviual inspection or fail the test Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30629
* ng_macfilter_test: Skip rather than fail if there is no networkAlex Richardson2021-03-251-2/+1
| | | | | | | | | | This should bring the number of Jenkins failures from 4 down to 3. Locally kyua now prints `skipped: could not find a valid interface [0.115s]` when I run it in QEMU without a network device. Reviewed By: lwhsu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29414
* tests/sys/netgraph: Further CI fixesAlex Richardson2021-03-191-21/+36
| | | | | | | | | | | | I was trying to debug why this test is working locally but failing in CI. While doing so I made some small changes to allow running it with set -e. It turns out the problem is that find_iface does not return anything in Jenkins, so all following tests fail with obscure error messages. To handle this case exit early if $eth is empty. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D29340
* tests/sys/netgraph/ng_macfilter_test: Fix invalid TAP outputAlex Richardson2021-03-121-23/+23
| | | | | | | | | | | This should allow the test to pass in Jenkins. Testing it locally now reports "passed" instead of "invalid TAP data". While touching this file also fix some shellcheck warnings that were pointed out by my IDE. Reviewed By: lwhsu, afedorov Differential Revision: https://reviews.freebsd.org/D29054
* tests/sys/netgraph: Tell kyua that perl is requiredAlex Richardson2021-02-231-1/+2
| | | | | | | Otherwise these tests fail with incomprehensible error messages. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28894
* New Netgraph module ng_macfilter:Nick Hibma2020-12-082-0/+444
Macfilter to route packets through different hooks based on sender MAC address. Based on ng_macfilter written by Pekka Nikander Sponsered by Retina b.v. Reviewed by: afedorov MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27268 Notes: svn path=/head/; revision=368443