aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* pf tests: Test scrub fragment reassemble on interfaces with different MTUKristof Provost2021-04-301-0/+49
| | | | | | | | | | | | There's a problem with pf's reassembly code where it produces incorrect checksums when reassembling across interfaces with different MTUs. Test this. PR: 255432 Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30013
* poll(2): Add POLLRDHUP.Thomas Munro2021-04-281-0/+141
| | | | | | | | | | Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if requested. Triggered when the remote peer shuts down writing or closes its end. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29757
* pf tests: Test using '<ifgroup>:network' in tablesKristof Provost2021-04-271-0/+32
| | | | MFC after: 1 week
* pf tests: Test automatically generated tablesKristof Provost2021-04-261-0/+38
| | | | | | | | | | | Add a test case where the pfctl optimizer will generate a table automatically. These tables have long names, which we accidentally broke in the nvlist ADDRULE ioctl. Reviewed by: melifaro MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29989
* pf tests: Test killing states with multiple labelsKristof Provost2021-04-261-0/+79
| | | | | | | | | Now that we support having multiple labels on a rule ensure that we can use each rule label to kill states. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29938
* Improve debugging output on routing tests failure.Alexander V. Chernikov2021-04-241-1/+31
| | | | | | | | | | Most of the routing tests create per-test VNET, making it harder to repeat the failure with CLI tools. Provide an additional route/nexthop data on failure. Differential Revision: https://reviews.freebsd.org/D29957 Reviewed by: kp MFC after: 2 weeks
* Correctly skip rtsock_l3 test when if_epair is not availableAlex Richardson2021-04-231-6/+4
| | | | | | | | | | | This logic was accidentally changed in 67f2f67fc8ce8484066e95dabac5af892888fca1 Reported By: olivier X-MFC-With: 67f2f67fc8ce8484066e95dabac5af892888fca1 Tested By: kp Reviewed By: kp, melifaro Fixes: 67f2f67fc8ce ("Update rtsock_l3 test after 2fe5a79425c7") Differential Revision: https://reviews.freebsd.org/D29944
* Update rtsock_l3 test after 2fe5a79425c79f7b828acd91da66d97230925fc8Alex Richardson2021-04-212-20/+27
| | | | | | | | | Two of these tests now pass. Looking at Jenkins to find the first commit where this behaviour changed indicates that 2fe5a79425c79f7b828acd91da66d97230925fc8 is the most likely cause. Reviewed By: melifaro Differential Revision: https://reviews.freebsd.org/D28886
* pf tests: IPv6 test case for the 'kill state(s)' featureKristof Provost2021-04-202-1/+100
| | | | | | | Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29797
* pf tests: Test cases for the 'kill state(s)' featureKristof Provost2021-04-202-0/+176
| | | | | | MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29796
* Fix typo in rtsock_common.hAlexander V. Chernikov2021-04-191-1/+1
| | | | MFC after: 3 days
* pf tests: Test set keepcountersKristof Provost2021-04-191-0/+82
| | | | | | MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29781
* bridge tests: Test STP config BPDU validationKristof Provost2021-04-193-1/+163
| | | | | | PR: 254924 Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D29783
* Add some regression tests for O_PATH and AT_EMPTY_PATHMark Johnston2021-04-152-0/+779
| | | | | | | Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29719
* pf tests: Test clearing rules countersKristof Provost2021-04-142-0/+80
| | | | | | | | | This was briefly broken, so ensure that we can read and clear rules counters. MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29728
* pf: Implement the NAT source port selection of MAP-E Customer EdgeKurosawa Takahiro2021-04-132-0/+92
| | | | | | | | | | | MAP-E (RFC 7597) requires special care for selecting source ports in NAT operation on the Customer Edge because a part of bits of the port numbers are used by the Border Relay to distinguish another side of the IPv4-over-IPv6 tunnel. PR: 254577 Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D29468
* shared shadow vm object invalidation regression testRyan Libby2021-04-072-1/+362
| | | | | | | | | | | | Add a regression test for a scenario where a shadow vm object is shared by multiple mappings. If a page COW occurs through one of the mappings, then the virtual-to-physical mapping may become invalidated. This tests the scenario from CVE-2021-29626 which was fixed by 982693bb729badac4e65ecd59772979f2849a2b2. Reviewed by: markj Sponsored by: Dell EMC Isilon
* pf tests: Test multi-wan rdrKristof Provost2021-04-071-0/+83
| | | | | | | | | | This replicates an issue observed on pfSense: https://redmine.pfsense.org/issues/11436 In essence, reply-to is needed to ensure that connections always leave the WAN interface they came in on, but this confused the state tracking. MFC after: 2 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf tests: make synproxy and nat work correctly even if inetd is runningKurosawa Takahiro2021-04-072-2/+4
| | | | | | | | | | | | | | tests/sys/netfil/pf/synproxy fails if inetd has been running outside of the jail because pidfile_open() fails with EEXIST. tests/sys/netfil/pf/nat has the same problem but the test succeeds because whether inetd is running is not so important. Fix the problem by changing the pidfile path from the default location. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29622
* tests/sys/net/routing: XFAIL the two failing testsAlex Richardson2021-04-071-0/+6
| | | | | | | | | | | | They have been failing for 1.5 months and the patch to fix them is stuck in review so mark them as XFAIL for now to get Jenkins back to green. To be reverted when https://reviews.freebsd.org/D28886 (or similar) is commited. Reviewed By: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29528
* netmap: update unit tests with libnetmap testsVincenzo Maffione2021-04-022-13/+309
|
* netmap: several typo fixesVincenzo Maffione2021-04-021-0/+10
| | | | No functional changes intended.
* 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/net/if_lagg_test: Fix syntax errorAlex Richardson2021-03-221-1/+1
| | | | Fixes: ee231b27ff ("Also skip sys/net/if_lagg_test:witness on non-i386")
* Also skip sys/net/if_lagg_test:witness on non-i386Alex Richardson2021-03-191-2/+1
| | | | | | | | | | The LOR also happens on amd64 and other architectures. Ideally we would fix this. However, in order to get Jenkins green again to catch real regressions, we should skip this test for now. PR: 251726 Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D29341
* 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
* fusefs: fix two bugs regarding fcntl file locksAlan Somers2021-03-183-3/+66
| | | | | | | | | | | | 1) F_SETLKW (blocking) operations would be sent to the FUSE server as F_SETLK (non-blocking). 2) Release operations, F_SETLK with lk_type = F_UNLCK, would simply return EINVAL. PR: 253500 Reported by: John Millikin <jmillikin@gmail.com> MFC after: 2 weeks
* Unbreak MSG_CMSG_CLOEXECAlex Richardson2021-03-181-10/+35
| | | | | | | | | | | | | MSG_CMSG_CLOEXEC has not been working since 2015 (SVN r284380) because _finstall expects O_CLOEXEC and not UF_EXCLOSE as the flags argument. This was probably not noticed because we don't have a test for this flag so this commit adds one. I found this problem because one of the libwayland tests was failing. Fixes: ea31808c3b07 ("fd: move out actual fp installation to _finstall") MFC after: 3 days Reviewed By: mjg, kib Differential Revision: https://reviews.freebsd.org/D29328
* pf tests: pfsync bulk update testKristof Provost2021-03-171-0/+68
| | | | | | | | | | | Test that pfsync works as expected with bulk updates. That is, create some state before setting up the second firewall. Let that firewall request a bulk update so it can catch up, and check that it got the state which was created before it enable pfsync. PR: 254236 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29272
* base: remove if_wg(4) and associated utilities, manpageKyle Evans2021-03-172-197/+1
| | | | | | | | | | | | After length decisions, we've decided that the if_wg(4) driver and related work is not yet ready to live in the tree. This driver has larger security implications than many, and thus will be held to more scrutiny than other drivers. Please also see the related message sent to the freebsd-hackers@ and freebsd-arch@ lists by Kyle Evans <kevans@FreeBSD.org> on 2021/03/16, with the subject line "Removing WireGuard Support From Base" for additional context.
* tests: netinet: add missing up from local changeKyle Evans2021-03-151-2/+2
|
* if_wg: import latest fixup work from the wireguard-freebsd projectKyle Evans2021-03-152-1/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the culmination of about a week of work from three developers to fix a number of functional and security issues. This patch consists of work done by the following folks: - Jason A. Donenfeld <Jason@zx2c4.com> - Matt Dunwoodie <ncon@noconroy.net> - Kyle Evans <kevans@FreeBSD.org> Notable changes include: - Packets are now correctly staged for processing once the handshake has completed, resulting in less packet loss in the interim. - Various race conditions have been resolved, particularly w.r.t. socket and packet lifetime (panics) - Various tests have been added to assure correct functionality and tooling conformance - Many security issues have been addressed - if_wg now maintains jail-friendly semantics: sockets are created in the interface's home vnet so that it can act as the sole network connection for a jail - if_wg no longer fails to remove peer allowed-ips of 0.0.0.0/0 - if_wg now exports via ioctl a format that is future proof and complete. It is additionally supported by the upstream wireguard-tools (which we plan to merge in to base soon) - if_wg now conforms to the WireGuard protocol and is more closely aligned with security auditing guidelines Note that the driver has been rebased away from using iflib. iflib poses a number of challenges for a cloned device trying to operate in a vnet that are non-trivial to solve and adds complexity to the implementation for little gain. The crypto implementation that was previously added to the tree was a super complex integration of what previously appeared in an old out of tree Linux module, which has been reduced to crypto.c containing simple boring reference implementations. This is part of a near-to-mid term goal to work with FreeBSD kernel crypto folks and take advantage of or improve accelerated crypto already offered elsewhere. There's additional test suite effort underway out-of-tree taking advantage of the aforementioned jail-friendly semantics to test a number of real-world topologies, based on netns.sh. Also note that this is still a work in progress; work going further will be much smaller in nature. MFC after: 1 month (maybe)
* 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/cddl: correctly quote atf_set "require.progs"Alex Richardson2021-03-08106-705/+705
| | | | | | | | | | The argument has to be a single whitespace-separate value. While touching all these lines also add ksh93, since `atf_set "require.progs"` overrides the default value specified in the Kyuafile. This then results in tests being executed despite ksh93 not being installed. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D29066
* pf tests: Test tos/dscp matchingKristof Provost2021-03-062-1/+97
| | | | | | MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29078
* Fix GCC build of ptrace_test after 96a9e50e63bfcAlex Richardson2021-03-031-39/+50
| | | | | | | | It seems like GCC's -Wsign-compare is stricter and also warns for constants. Appease GCC by adding the required casts. Fixes: 96a9e50e63bfc ("ptrace_test: Add more debug output on test failures") Reported by: Jenkins CI
* tests/sys/audit: add missing comma delimiter between fieldsAlex Richardson2021-03-021-0/+1
| | | | | | | | | This makes the `kyua report --verbose` output a lot easier to parse when looking at failed tests. It also fixes the closefrom() test since I tested my changes with this commit but forgot to push it together with fa32350347b4e351a144b5423f0fb2ca9d67f4ca. Fixes: fa32350347b4 ("close_range: add audit support")
* Simplify the capsicum-test wrapper scriptAlex Richardson2021-03-021-53/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of running tests one-by-one with the shell wrapper we now run the full gtest testsuite twice (once as root, once as non root). This significantly speeds up running tests despite running them twice. This change also passes the missing -u flag to capsicum-test that caused test failures (https://bugs.freebsd.org/250178) Previously, running the testsuite with the wrapper script took ~3s per test on aarch64 QEMU, i.e. a total of almost 5 minutes. Now it takes 6 seconds to run all tests twice. Before: root@freebsd-aarch64:/usr/tests/sys/capsicum # /usr/bin/time kyua test functional 94/96 passed (2 failed) 309.97 real 58.46 user 244.31 sys After: root@freebsd-aarch64:/usr/tests/sys/capsicum # /usr/bin/time kyua test functional functional:test_root -> passed [2.659s] functional:test_unprivileged -> passed [2.391s] 2/2 passed (0 failed) 5.48 real 1.06 user 2.52 sys This overhead is caused by kyua + atf-sh spawning lots of additional processes and can be avoided by just running the googletest test binary. syscall seconds calls errors fork 39.810229456 1275 0 sigprocmask 13.546928736 572 0 i.e. 1275 processes spawned to run a single test. Test Plan: All tests pass with D28907. PR: 250178 Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D29014
* Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40Alex Richardson2021-03-021-1/+1
| | | | | | | | | | | | | | This includes various fixes that I submitted recently such as updating the pdkill() tests for the actual implemented behaviour (https://github.com/google/capsicum-test/pull/53) and lots of changes to avoid calling sleep() and replacing it with reliable synchronization (pull requests 49,51,52,53,54). This should make the testsuite more reliable when running on Jenkins. Additionally, process status is now retrieved using libprocstat instead of running `ps` and parsing the output (https://github.com/google/capsicum-test/pull/50). This fixes one previously failing test and speeds up execution. Overall, this update reduces the total runtime from ~60s to about 4-5 seconds.
* Fix ptrace_test:ptrace__syscall_args after ATF upgradeAlex Richardson2021-03-011-2/+3
| | | | | | | | | ATF now opens the results file (without CLOEXEC), so the child actually has a valid file descriptor 3. To fix this simply use a large number that will definitely not be a valid file descriptor. Reviewed by: jhb, cem, lwhsu Differential Revision: https://reviews.freebsd.org/D28889
* Remove atf_tc_skip calls from ptrace_testAlex Richardson2021-03-011-27/+2
| | | | | | | | | | | I've run these tests many times in a loop on multiple architectures and it works reliably for me, maybe it's time to retire these skips? This also adds an additional waitpid to one of the tests to avoid a potential race condition (suggested by markj@). PR: 239397, 244056, 239425, 240510, 220841, 243605 Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D28888
* ptrace_test: Add more debug output on test failuresAlex Richardson2021-03-011-746/+770
| | | | | | | | | | | | | | | | Mostly automatic, using `CHILD_REQUIRE\(([^|&\n]*) ==` -> `CHILD_REQUIRE_EQ_INT($1,` `ATF_REQUIRE\(([^|&\n]*) ==` -> `REQUIRE_EQ_INT($1,` followed by git-clang-format -f and then manually checking ones that contain ||/&&. Test Plan: Still getting the same failure but now it prints `psr.sr_error (0) == EBADF (9) not met` instead of just failing without printing the values. PR: 243605 Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D28887
* tests/sys/netpfil/pf: Add missing python3 requirementsAlex Richardson2021-03-012-1/+3
| | | | | | | | | This also fixes a typo in the dup test that caused the head function to not be called. On my test system without python3 the tests are now skipped instead of failing. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28903
* bridge tests: Test that we also forward on some interfacesKristof Provost2021-02-251-0/+18
| | | | | | | | | | Ensure that we not only block on some interfaces, but also forward on some. Without the previous commit we wound up discarding on all ports, rather than only on the ports needed to break the loop. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28917
* Remove __NO_TLS.Konstantin Belousov2021-02-231-1/+0
| | | | | | | | | All supported platforms support thread-local vars and __thread. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28796
* close_range: add audit supportAlex Richardson2021-02-231-2/+2
| | | | | | | | | | | | | This fixes the closefrom test in sys/audit. Includes cherry-picks of the following commits from openbsm: https://github.com/openbsm/openbsm/commit/4dfc628aafe589d68848f7033f3d3488c4d979e0 https://github.com/openbsm/openbsm/commit/99ff6fe32aebc5a4b8d40d60062b8574697df557 https://github.com/openbsm/openbsm/commit/da48a0399e95448693d3fa2be48454ca564c1be8 Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28388
* 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
* bridge tests: Test STP on top of VLAN devicesKristof Provost2021-02-231-0/+66
| | | | | | | | | This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861
* Add arp/ndp tests in addition to rtsock ll tests.Alexander V. Chernikov2021-02-204-2/+215
|
* tests/sys/audit: force PIE offEd Maste2021-02-191-0/+1
| | | | | | | | df093aa9463b linked against libprivateauditd.a, but that is currently (and incorrectly) built as position-dependent. For now just force PIE off for this test to fix the WITH_PIE build. Sponsored by: The FreeBSD Foundation