aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* netinet tests: delete an interface with pending lookupsKristof Provost2021-08-171-0/+36
| | | | | | | | This has been known to trigger panics. It currently doesn't, but we may as well have a test for it. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* bitstring(3): Add bitstring traversal macros.Vladimir Kondratyev2021-08-161-0/+207
| | | | | | | | | | | | | | | | The macro bit_foreach() traverses all set bits in the bitstring in the forward direction, assigning each location in turn to variable. The macro bit_foreach_at() traverses all set bits in the bitstring in the forward direction at or after the zero-based bit index, assigning each location in turn to variable. The bit_foreach_unset() and bit_foreach_unset_at() macros which traverses unset bits are implemented for completeness. Reviewed by: asomers, dougm MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31469
* Add test for fstatat(pipefd, AT_EMPTY_PATH)Konstantin Belousov2021-08-141-0/+20
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* aio: revert the workaround for bug 251828 in the testsAlan Somers2021-08-141-7/+0
| | | | | | | | | | | | | This bug is no longer reproducible in 14.0-CURRENT and 13.0-RELEASE Do not MFC to stable/12 ! PR: 251828 Reported by: markj Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D31535
* uipc_shm: Implements fspacectl(2) supportKa Ho Ng2021-08-121-0/+199
| | | | | | | | | | | | | | This implements fspacectl(2) support on shared memory objects. The semantic of SPACECTL_DEALLOC is equivalent to clearing the backing store and free the pages within the affected range. If the call succeeds, subsequent reads on the affected range return all zero. tests/sys/posixshm/posixshm_tests.c is expanded to include a fspacectl(2) functional test. Sponsored by: The FreeBSD Foundation Reviewed by: kevans, kib Differential Revision: https://reviews.freebsd.org/D31490
* Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9).Ka Ho Ng2021-08-052-0/+339
| | | | | | | | | | | | | | | | | | | | | | fspacectl(2) is a system call to provide space management support to userspace applications. VOP_DEALLOCATE(9) is a VOP call to perform the deallocation. vn_deallocate(9) is a public KPI for kmods' use. The purpose of proposing a new system call, a KPI and a VOP call is to allow bhyve or other hypervisor monitors to emulate the behavior of SCSI UNMAP/NVMe DEALLOCATE on a plain file. fspacectl(2) comprises of cmd and flags parameters to specify the space management operation to be performed. Currently cmd has to be SPACECTL_DEALLOC, and flags has to be 0. fo_fspacectl is added to fileops. VOP_DEALLOCATE(9) is added as a new VOP call. A trivial implementation of VOP_DEALLOCATE(9) is provided. Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28347
* Fix MK_TESTS build with MK_ASAN/MK_UBSANAlex Richardson2021-08-021-0/+6
| | | | | Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D31049
* bridge tests: verify that we can't change MTU of bridge member interfacesKristof Provost2021-07-281-0/+5
| | | | | | Reviewed by: donner Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31305
* bridge tests: test changing the bridge MTUKristof Provost2021-07-281-0/+68
| | | | | | | | | Changing the bridge MTU will now also change all of the member interface MTUs. Test this. Reviewed by: donner Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31289
* pf tests: make killstate:match more robustKristof Provost2021-07-271-3/+3
| | | | | | | | | | | Only lists the states relevant to the connection we're killing. Sometimes there are IPv6 related states (due to the usual IPv6 background traffic of router solicitations, DAD, ...) that causes us to think we failed to kill the state, which in turn caused the test to fail intermittently. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate")
* net tests: basic test case for bpf(4)'s ability to set vlan pcpKristof Provost2021-07-265-3/+134
| | | | | | | | | Use dhclient with its 'vlan-pcp' option to set a VLAN PCP value and verify that it actually gets set. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31276
* bridge tests: test linking bridges with a gif tunnelKristof Provost2021-07-261-0/+66
| | | | | | | | Fairly basic test case for using gif(4)'s ability to tunnel Ethernet traffic between bridges. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* aio_md_test: label the mdEric van Gyzen2021-07-231-0/+2
| | | | | | | | | Add a label to md devices created by this test. The next time this test leaks md devices, finding the culprit will be much easier. Thanks to: sobomax, for adding labels in r322969 MFC after: 1 week Sponsored by: Dell EMC Isilon
* aio_md_test: NUL-terminate result of readlinkEric van Gyzen2021-07-231-1/+2
| | | | | | | | | | readlink does not NUL-terminate the output buffer. This led to spurious failures to destroy the md device because the unit number was garbage. NUL-terminate the output buffer. Reported by: ASLR MFC after: 1 week Sponsored by: Dell EMC Isilon
* aio_md_test: fix cleanupEric van Gyzen2021-07-231-7/+9
| | | | | | | | | | | ATF cleanup functions cannot use functions such as ATF_REQUIRE and atf_tc_fail. These functions assert that a test case is currently running, which is not true during cleanup, so the process aborts. Change the cleanup function to simply print to stderr and return. MFC after: 1 week Sponsored by: Dell EMC Isilon
* pf tests: ensure syncookie does not create stateKristof Provost2021-07-201-0/+49
| | | | | | | | | Test that with syncookies enabled pf does not create state for connections before the remote peer has replied to the SYN|ACK message. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31142
* pf tests: Forwarding syncookie testKristof Provost2021-07-202-0/+85
| | | | | | | | | | Test syncookies on a forwarding host. That is, in a setup where the machine (or vnet) running pf is not the same as the machine (or vnet) running the server it's protecting. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31141
* pf tests: test locally originated connections with route-toKristof Provost2021-07-171-0/+70
| | | | | | | PR: 257106 Submitted by: Mark Cammidge <mark@peralex.com> MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D31178
* pf tests: Test the match keywordKristof Provost2021-07-171-0/+45
| | | | | | | | | | | The new match keyword can currently only assign queues, so we can only test it with ALTQ. Set up a basic scenario where we use 'match' to assign ICMP traffic to a slow queue, and confirm that it's really getting slowed down. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31116
* lio_listio: Don't post a completion notification if none was requestedMark Johnston2021-07-161-0/+10
| | | | | | | | | | | | | | | One is allowed to use LIO_NOWAIT without specifying a sigevent. In this case, lj->lioj_signal is left uninitialized, but several code paths examine liov_signal.sigev_notify to figure out which notification to post. Unconditionally initialize that field to SIGEV_NONE. Add a dumb test case which triggers the bug. Reported by: KMSAN+syzkaller Reviewed by: asomers MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31197
* Skip netgraph tests when WITHOUT_NETGRAPH is setEd Maste2021-07-061-1/+5
| | | | | | | PR: 256986 Reported by: John Marshall MFC after: 1 week Sponsored by: The FreeBSD Foundation
* tests/libalias: Bugfix in used variablesLutz Donnerhacke2021-07-021-2/+2
| | | | | | Fix two copy and waste errors (referencing the wrong variable). MFC after: 3 days
* pf tests: Stress state retrievalKristof Provost2021-07-024-0/+146
| | | | | | | | | | | | Create and retrieve 20.000 states. There have been issues with nvlists causing very slow state retrieval. We don't impose a specific limit on the time required to retrieve the states, but do log it. In excessive cases the Kyua timeout will fail this test. Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30943
* pf tests: ftp-proxy testKristof Provost2021-07-012-0/+96
| | | | | | | | Basic test case for ftp-proxy PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* fusefs: correctly set lock owner during FUSE_SETLKAlan Somers2021-06-261-20/+30
| | | | | | | | | | | | | | | | During FUSE_SETLK, the owner field should uniquely identify the calling process. The fusefs module now sets it to the process's pid. Previously, it expected the calling process to set it directly, which was wrong. libfuse also apparently expects the owner field to be set during FUSE_GETLK, though I'm not sure why. PR: 256005 Reported by: Agata <chogata@moosefs.pro> MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D30622
* fusefs: ensure that FUSE ops' headers' unique values are actually uniqueAlan Somers2021-06-192-0/+12
| | | | | | | | | | | | | | | | | Every FUSE operation has a unique value in its header. As the name implies, these values are supposed to be unique among all outstanding operations. And since FUSE_INTERRUPT is asynchronous and racy, it is desirable that the unique values be unique among all operations that are "close in time". Ensure that they are actually unique by incrementing them whenever we reuse a fuse_dispatcher object, for example during fsync, write, and listextattr. PR: 244686 MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D30810
* fusefs: also debug INIT operations in the test suiteAlan Somers2021-06-191-0/+2
| | | | | MFC after: 2 weeks Reviewed by: pfg
* fusefs: support EVFILT_WRITE on /dev/fuseAlan Somers2021-06-161-3/+17
| | | | | | | | | /dev/fuse is always ready for writing, so it's kind of dumb to poll it. But some applications do it anyway. Better to return ready than EINVAL. MFC after: 2 weeks Reviewed by: emaste, pfg Differential Revision: https://reviews.freebsd.org/D30784
* gconcat: Add some simple regression tests for the new append verbMark Johnston2021-06-143-0/+127
| | | | 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/sys/netpfil: Move common tests out from behind MK_PF.Brad Davis2021-06-101-2/+2
| | | | | Approved by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* 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
* pf tests: Make killstate:match more robustKristof Provost2021-06-031-0/+13
| | | | | | | | | | | | The killstate:match test starts nc as a background process. There was no guarantee that the nc process would have connected by the time we check for states, so this test occasionally failed without good reason. Teach the test to wait for at least some states to turn up before executing the critical checks. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate")
* netpfil tests: Basic dummynet pipe testKristof Provost2021-06-033-0/+91
| | | | | | | | | | Test dummynet pipes (i.e. bandwidth limitation) with ipfw. This is put in the common tests because we hope to add dummynet support to pf in the near future. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30380
* fusefs: reenable the WriteCluster.cluster_write_err testAlan Somers2021-05-301-2/+2
| | | | | | | | | The underlying panic was just fixed by revision 27006229f7a40a18a61a0e8fd270bc583326b690 PR: 238565 MFC after: 1 week MFC with: 27006229f7a40a18a61a0e8fd270bc583326b690
* tests/libalias: Measure cleanup time separatlyLutz Donnerhacke2021-05-281-3/+7
| | | | | After long test runs, a lot of ressouces can be allocated. Freeing them takes a considerable amount of time.
* tests/libalias: Fix build error due to wrong prototypeLutz Donnerhacke2021-05-261-1/+1
|
* tests/libalias: Add missing prototype to fix build errorLutz Donnerhacke2021-05-261-0/+2
|
* tests/libalias: Add port forwardingsLutz Donnerhacke2021-05-261-13/+49
| | | | | | | | Add port forwardings to the performance tests. This will cause random incoming packets to match the random port forwardings opends beforehand. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30443
* tests/libalias: Improve testingLutz Donnerhacke2021-05-261-48/+88
| | | | | | | | | | | | | | | | gettimeofday(3) is almost as expensive as the calls to libalias. So the call frequency for this call is reduced by a factor of 1000 in order to neglect it's influence. Using NAT entries became more realistic: A communication of a random length of up to 150 packets (10% outgoing, 90% incoming) is applied for each entry. Precision of the execution time is raised to see the trends better. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30405
* tests/libalias: Test LibAliasIn on redirectionLutz Donnerhacke2021-05-262-0/+383
| | | | | | | | Extend the test suite for libalias(3) to incoming connections. Test the various types of redirections. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30408
* tests/libalias: Factor out common primitivesLutz Donnerhacke2021-05-264-158/+144
| | | | | | | | Rework the tests to check the correct layer in a single test. Factor out tests for reuse in other modules. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30412