aboutsummaryrefslogtreecommitdiff
path: root/tests/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Enable net testsKristof Provost2020-02-131-0/+1
| | | | | | | | We have a number of tests in the net subdirectory that were not executed. List the net directory so we run those tests. Notes: svn path=/head/; revision=357857
* * Fix flaking lle tests by filtering out non-relevant rtsock messages.Alexander V. Chernikov2020-02-121-77/+24
| | | | | | | | | | * Consistently use RTM_DECLARE_ROOT_TEST() macro. * Temporarily remove iftype validation from IPv6 lle notifications. Reported by: kp Notes: svn path=/head/; revision=357843
* fusefs: fix some memory leaks in the tests.Alan Somers2020-02-122-0/+8
| | | | | | | | | | | Oddly, most of these were not detected by Coverity. Reported by: Coverity (one of them, anyway) Coverity CID: 1404490 MFC after: 2 weeks Notes: svn path=/head/; revision=357835
* Tag pjdfstest symlink with pkgbase packageEd Maste2020-02-121-1/+1
| | | | | | | | | | | As with the rest of pjdfstest, tag the symlink with package=tests. The tests -> . symlink seems a little strange but that's independent of pkgbase. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357833
* Temporarily skip flakey test case ↵Li-Wen Hsu2020-02-111-0/+3
| | | | | | | | | | sys.kern.ptrace_test.ptrace__parent_exits_before_child PR: 244056 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357782
* Temporarily skip failing test case ↵Li-Wen Hsu2020-02-111-0/+3
| | | | | | | | | | sys.kern/ptrace_test/ptrace__parent_wait_after_attach PR: 244055 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357781
* Temporarily skip sys.geom.class.multipath.failloop.failloop in CILi-Wen Hsu2020-02-111-0/+4
| | | | | | | | | | This case uses `dtrace -c` but it has some issues at the moment PR: 244053 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357780
* Reduce nc timeout in sys.mac.portacl.*Li-Wen Hsu2020-02-111-2/+3
| | | | | | | | | It is not necessary to wait that long for localhost. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357778
* tests: epair: Don't fail if we load if_epairKristof Provost2020-02-011-1/+1
| | | | | | | | | | | kldload() returns a positive integer when it loads a ko, so check that the return value is -1 to detect error cases, not that it's different from zero. MFC after: 3 days X-MFC-With: r357234 Notes: svn path=/head/; revision=357375
* tests: epair: Don't fail if the if_epair module is already loadedKristof Provost2020-02-011-2/+4
| | | | | | | | | | | | | kldload() returns an error (EEXIST) if the module is already loaded. That's not a problem for us, so ignore that error. While here also clean up include statements. MFC after: 3 days X-MFC-With: r357234 Notes: svn path=/head/; revision=357365
* Revert r357246Conrad Meyer2020-01-291-17/+52
| | | | | | | | | I have no idea what this code is trying to do, leave it be. Reported by: lwhsu Notes: svn path=/head/; revision=357273
* qmath(3) test: Replace overcomplicated abomination with arc4random(3)Conrad Meyer2020-01-291-52/+17
| | | | | | | | | | | | | | | | | The horrific GENRAND construction bent over backwards to construct 64-bit signed integers from the 31-bit output of random(3) for about 20 numbers per test. Reproducibility wasn't a goal: random(3) was seeded with srandomdev(3). Speed is not a factor for generating 20 integers with arc4random(3). Range is not a factor: all uses did not bound the range beyond that of the full [INT64_MIN, INT64_MAX]. Just use arc4random(3). Reported by: Coverity CIDs: 1404809, 1404817, 1404838, 1404840 and about 6x other identical reports of dubious code relating to the construction Notes: svn path=/head/; revision=357246
* tests: Test for an epair panicKristof Provost2020-01-282-1/+75
| | | | | | | | | | | | if_epair abused the ifr_data field to insert its second interface in IFC_IFLIST. If userspace provides a value for ifr_data it would get dereferenced by the kernel leading to a panic. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 3 days Notes: svn path=/head/; revision=357234
* geli: add a test case for attaching multiple providers with 1 commandAlan Somers2020-01-281-0/+31
| | | | | | | | | | Reviewed by: cem MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D23400 Notes: svn path=/head/; revision=357211
* Temporarily skip flakey test case ↵Li-Wen Hsu2020-01-261-0/+3
| | | | | | | | | | sys.kern.ptrace_test.ptrace__procdesc_reparent_wait_child PR: 243605 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357137
* Specify PACKAGE to install tests filesLi-Wen Hsu2020-01-251-0/+2
| | | | | | | | | MFC after: 3 weeks MFC with: r356984 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357126
* tests: Routing tests overwrote net testsKristof Provost2020-01-251-1/+1
| | | | | | | | | | | The routing subdirectory installed into the same directory as the test tests, which caused them to overwrite the net Kyuafile. As a result these tests were not executed. X-MFC-With: r356146 Notes: svn path=/head/; revision=357113
* Bring back redirect route expiration.Alexander V. Chernikov2020-01-227-6/+410
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Redirect (and temporal) route expiration was broken a while ago. This change brings route expiration back, with unified IPv4/IPv6 handling code. It introduces net.inet.icmp.redirtimeout sysctl, allowing to set an expiration time for redirected routes. It defaults to 10 minutes, analogues with net.inet6.icmp6.redirtimeout. Implementation uses separate file, route_temporal.c, as route.c is already bloated with tons of different functions. Internally, expiration is implemented as an per-rnh callout scheduled when route with non-zero rt_expire time is added or rt_expire is changed. It does not add any overhead when no temporal routes are present. Callout traverses entire routing tree under wlock, scheduling expired routes for deletion and calculating the next time it needs to be run. The rationale for such implemention is the following: typically workloads requiring large amount of routes have redirects turned off already, while the systems with small amount of routes will not inhibit large overhead during tree traversal. This changes also fixes netstat -rn display of route expiration time, which has been broken since the conversion from kread() to sysctl. Reviewed by: bz MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D23075 Notes: svn path=/head/; revision=356984
* tests: fusefs: silence remaining unsigned/signed comparison warningsKyle Evans2020-01-101-3/+3
| | | | | | | | | | External GCC turns these into errors; cast to long to silence them. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D23127 Notes: svn path=/head/; revision=356614
* Include human-readable list of rtm flags along with bitmask in error messagesAlexander V. Chernikov2020-01-102-3/+21
| | | | | | | | | for rtsock tests. MFC after: 2 weeks Notes: svn path=/head/; revision=356596
* posixshm: implement posix_fallocate(2)Kyle Evans2020-01-081-0/+39
| | | | | | | | | | | | | Linux expects to be able to use posix_fallocate(2) on a memfd. Other places would use this with shm_open(2) to act as a smarter ftruncate(2). Test has been added to go along with this. Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D23042 Notes: svn path=/head/; revision=356512
* Fix rtsock route message generation for interface addresses.Alexander V. Chernikov2020-01-073-26/+646
| | | | | | | | | Reviewed by: olivier MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22974 Notes: svn path=/head/; revision=356473
* Revert r355861 because the issue has been fixed in r356443Li-Wen Hsu2020-01-071-5/+0
| | | | | | | | | PR: 242689 Notified by: markj Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356458
* Refine fusefs test workaround for mips+llvmKyle Evans2020-01-061-0/+5
| | | | | | | | | | | | | | | | | | | | This re-enables building the googletest suite by default on mips and instead specifically doesn't build fusefs tests for mips+clang builds. clang will easily spent >= 1.5 hours compiling a single file due to a bug in optimization (see LLVM PR 43263), so turn these off for now while that's hashed out. GCC builds are unaffected and build the fusefs tests as-is. Clang builds only happen by early adopters attempting to hash out the remaining issues. The comment has been updated to reflect its new position and use less strong wording about imposing on people. Discussed with: ngie, asomers Reviewed by: ngie Notes: svn path=/head/; revision=356423
* lio_listio_empty_nowait_thread sometimes does *not* hang.Bryan Drewery2020-01-041-0/+1
| | | | | | | | | The other tests consistently do hang though. Sponsored by: DellEMC Notes: svn path=/head/; revision=356352
* Add userland tests for route table/lltable rtsock operations.Alexander V. Chernikov2019-12-287-0/+2206
| | | | | | | | MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22860 Notes: svn path=/head/; revision=356146
* Temporarily skip failing sys.geom.class.multipath.failloop.failloop on i386 CILi-Wen Hsu2019-12-171-0/+5
| | | | | | | | PR: 242689 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355861
* gmultipath: add ATF testsAlan Somers2019-12-065-0/+561
| | | | | | | | | | | | | | Add ATF tests for most gmultipath operations. Add some dtrace probes too, primarily for configuration changes that happen in response to provider errors. PR: 178473 MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D22235 Notes: svn path=/head/; revision=355431
* procdesc: allow to collect status through wait(1) if process is tracedMariusz Zaborski2019-11-251-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | The debugger like truss(1) depends on the wait(2) syscall. This syscall waits for ALL children. When it is waiting for ALL child's the children created by process descriptors are not returned. This behavior was introduced because we want to implement libraries which may pdfork(1). The behavior of process descriptor brakes truss(1) because it will not be able to collect the status of processes with process descriptors. To address this problem the status is returned to parent when the child is traced. While the process is traced the debugger is the new parent. In case the original parent and debugger are the same process it means the debugger explicitly used pdfork() to create the child. In that case the debugger should be using kqueue()/pdwait() instead of wait(). Add test case to verify that. The test case was implemented by markj@. Reviewed by: kib, markj Discussed with: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20362 Notes: svn path=/head/; revision=355097
* Fix gcc buildLi-Wen Hsu2019-11-241-0/+6
| | | | | | | | | | | | | | | | | | | We have -Werror=strict-overflow so gcc complains: In file included from /tmp/obj/workspace/src/amd64.amd64/tmp/usr/include/bitstring.h:36:0, from /workspace/src/tests/sys/sys/bitstring_test.c:34: /workspace/src/tests/sys/sys/bitstring_test.c: In function 'bit_ffc_at_test': /workspace/src/sys/sys/bitstring.h:239:5: error: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Werror=strict-overflow] if (_start >= _nbits) { ^ Disable assuming overflow of signed integer will never happen by specifying -fno-strict-overflow Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355055
* The error messages that indicate bugs in 'area' bitstring functionsDoug Moore2019-11-231-18/+18
| | | | | | | | | | | should identify accurately which function exhibited the bug. Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22519 Notes: svn path=/head/; revision=355032
* Initialize variable bitstrLi-Wen Hsu2019-11-221-0/+2
| | | | | | | | | | r354991 removed variable-sized object initializing on defining. For the safe reason, manually initialize the members to 0. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354992
* Fix GCC build.Li-Wen Hsu2019-11-221-2/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354991
* bitstring: add functions to find contiguous set/unset bit sequencesEric Joyner2019-11-211-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bit_ffs_area_at and bit_ffc_area_at functions for searching a bit string for a sequence of contiguous set or unset bits of at least the specified size. The bit_ffc_area function will be used by the Intel ice driver for implementing resource assignment logic using a bitstring to represent whether or not a given index has been assigned or is currently free. The bit_ffs_area, bit_ffc_area_at and bit_ffs_area_at functions are implemented for completeness. I'd like to add further test cases for the new functions, but I'm not really sure how to add them easily. The new functions depend on specific sequences of bits being set, while the bitstring tests appear to run for varying bit sizes. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: asomers@, erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22400 Notes: svn path=/head/; revision=354977
* bitstring: exit early if _start is past size of the bitstringEric Joyner2019-11-211-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bit_ffs_at and bit_ffc_at both take _start parameters which indicate to start searching from _start onwards. If the given _start index is past the size of the bit string, these functions will calculate an address of the current bitstring which is after the expected size. The function will also dereference the memory, resulting in a read buffer overflow. The output of the function remains correct, because the tests ensure to stop the loop if the current bitstring chunk passes the stop bitstring chunk, and because of a check to ensure the reported _value is never past _nbits. However, if <sys/bitstring.h> is ever used in code which is checked by -fsanitize=undefined, or similar static analysis, it can produce warnings about reading past the buffer size. Because of the above mentioned checks, these buffer overflows do not occur as long as _start is less than _nbits. Additionally, by definition bit_ffs_at and bif_ffc_at should set _result to -1 in any case where the _start is after the _nbits. Check for this case at the start of the function and exit early if so, preventing the buffer read overflow, and reducing the amount of computation that occurs. Note that it may seem odd to ever have code that could call bit_ffc_at or bit_ffs_at with a _start value greater than _nbits. However, consider a for-loop that used bit_ffs and bit_ffs_at to loop over a bit string and perform some operation on each bit that was set. If the last bit of the bit string was set, the simplest loop implementation would call bit_ffs_at with a start of _nbits, and expect that to return -1. While it does infact perform correctly, this is what ultimately triggers the unexpected buffer read overflow. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: asomers@, erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22398 Notes: svn path=/head/; revision=354975
* icmpv6: Fix mbuf change in mldBjoern A. Zeeb2019-11-183-0/+168
| | | | | | | | | | | | | | | | | | | | After r354748 mld_input() can change the mbuf. The new pointer is never returned to icmp6_input() and when passed to icmp6_rip6_input() the mbuf may no longer valid leading to a panic. Pass a pointer to the mbuf to mld_input() so we can return an updated version in the non-error case. Add a test sending an MLD packet case which will trigger this bug. Pointyhat to: bz Reported by: gallatin, thj MFC After: 2 weeks X-MFC with: r354748 Sponsored by: Netflix Notes: svn path=/head/; revision=354832
* ipv6 testsBjoern A. Zeeb2019-11-181-0/+2
| | | | | | | | | | Add a simple ping6 test as well. MFC after: 2 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354831
* Jail and capability mode for shm_rename; add audit support for shm_renameDavid Bright2019-11-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | Co-mingling two things here: * Addressing some feedback from Konstantin and Kyle re: jail, capability mode, and a few other things * Adding audit support as promised. The audit support change includes a partial refresh of OpenBSM from upstream, where the change to add shm_rename has already been accepted. Matthew doesn't plan to work on refreshing anything else to support audit for those new event types. Submitted by: Matthew Bryan <matthew.bryan@isilon.com> Reviewed by: kib Relnotes: Yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22083 Notes: svn path=/head/; revision=354808
* Reenable netinet6 and netpfil tests on i386, net/scapy 2.4.3_2 contains the fixLi-Wen Hsu2019-11-086-30/+0
| | | | | | | | PR: 239380 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354553
* frag6: properly handle atomic fragments according to RFCs.Bjoern A. Zeeb2019-11-082-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | RFC 8200 says: "If the fragment is a whole datagram (that is, both the Fragment Offset field and the M flag are zero), then it does not need any further reassembly and should be processed as a fully reassembled packet (i.e., updating Next Header, adjust Payload Length, removing the Fragment header, etc.). .." That means we should remove the fragment header and make all the adjustments rather than just skipping over the fragment header. The difference should be noticeable in that a properly handled atomic fragment triggering an ICMPv6 message at an upper layer (e.g. dest unreach, unreachable port) will not include the fragment header. Update the test cases to also test for an unfragmentable part. That is needed so that the next header is properly updated (not just lengths). MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22155 Notes: svn path=/head/; revision=354542
* IPv6 tests: test case for scapy bpf parsing bugBjoern A. Zeeb2019-11-063-1/+183
| | | | | | | | | | PR: 239380 Reported by: lwhsu, CI system MFC after: 3 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354395
* ipv6 tests: cleanupBjoern A. Zeeb2019-11-062-6/+6
| | | | | | | | | | | | Remove mentions of fragmentation tests from extension header test. Remove setting an MTU > IF_MAXMTU from the test cases to avoid warnings; this was only possible in a local research tree. MFC after: 2 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354390
* Temporarily disable sys.netinet6.exthdr on i386Li-Wen Hsu2019-11-051-0/+5
| | | | | | | | PR: 241493 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354362
* ip6 tests: Add very simplistic extension header testsBjoern A. Zeeb2019-11-053-0/+407
| | | | | | | | | | | | | | | | Add a simple test case which can exercise some of the IPv6 extension header code paths. At the moment only a small set of extension headers is implemented and no options to the ones which take them. Also implements a "bad" case to make sure that error handling works. The tests were used to test m_pullup() changes to the code paths while removing the KAME PULLDOWN_TEST cases and related macros. MFC after: 3 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354358
* frag6 tests: set end to catch timeout as errorBjoern A. Zeeb2019-11-052-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | There are times when we have to wait for reply packets. There are either an ICMPv6 (error) reply or the expiration timeout. In these cases synchonous ICMPv6 replies should arrive, always, unless the packet is lost. Due to errors experienced with the test software sending an invlaid request on at least i386 (*) these packets are not generated. That means we are waiting for a long time for the replies or even timeout the test case. Manually set the "End" flag on these test cases as well, so they do fail rather than timeout as the sniffer timeout happens. This improves debugging options, reflects the error properly, and saves time on each test suit run. (*) The real cause for that is still to be found (see the referenced PRs) PR: 241493, 239380 MFC after: 2 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354357
* netpfil tests: Add missing copyright & license statementsKristof Provost2019-10-2919-0/+476
| | | | Notes: svn path=/head/; revision=354145
* Follow r354121 to fix some python3 errors in sys.netpfil.*Li-Wen Hsu2019-10-271-5/+5
| | | | | | | | | | | | | | | | | | | | | stderr: Traceback (most recent call last): File "/usr/tests/sys/netpfil/common/pft_ping.py", line 135, in <module> main() File "/usr/tests/sys/netpfil/common/pft_ping.py", line 124, in main ping(args.sendif[0], args.to[0], args) File "/usr/tests/sys/netpfil/common/pft_ping.py", line 74, in ping raw = sp.raw(str(PAYLOAD_MAGIC)) File "/usr/local/lib/python3.6/site-packages/scapy/compat.py", line 52, in raw return bytes(x) TypeError: string argument without an encoding MFC with: r354121 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354130
* Upgrade (scapy) py2 tests to work on py3.Bjoern A. Zeeb2019-10-263-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | In order to move python2 out of the test framework to avoid py2 vs. py3 confusions upgrade the remaining test cases using scapy to work with py3. That means only one version of scapy needs to be installed in the CI system. It also gives a path forward for testing i386 issues observed in the CI system with some of these tests. Fixes are: - Use default python from environment (which is 3.x these days). - properly ident some lines as common for the rest of the file to avoid errors. - cast the calculated offset to an int as the division result is considered a float which is not accepted input. - when comparing payload to a magic number make sure we always add the payload properly to the packet and do not try to compare string in the result but convert the data payload back into an integer. - fix print formating. Discussed with: lwhsu, kp (taking it off his todo :) MFC after: 2 weeks Notes: svn path=/head/; revision=354121
* frag6-test: update for r354046, conform to 8200 for overlapping fragmentsBjoern A. Zeeb2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | The change to conform to RFC 8200 for overlapping fragments now frees the entire reassembly queue if the overlapping fragments are not an exact match. As a result we do see one less packet in the timeout statistics from expiry. No other statistics change as the event is not counted. It can be argued that we should improve the statistics counters in that case. This test case update should have been committed alongside the original commit. Pointyhat to: bz MFC after: 3 weeks X-MFC with: r354046 Sponsored by: Netflix Notes: svn path=/head/; revision=354084
* frag6: prevent overwriting initial fragoff=0 packet meta-data.Bjoern A. Zeeb2019-10-243-1/+372
| | | | | | | | | | | | | | | | | | | | | | | | When we receive the packet with the first fragmented part (fragoff=0) we remember the length of the unfragmentable part and the next header (and should probably also remember ECN) as meta-data on the reassembly queue. Someone replying this packet so far could change these 2 (3) values. While changing the next header seems more severe, for a full size fragmented UDP packet, for example, adding an extension header to the unfragmentable part would go unnoticed (as the framented part would be considered an exact duplicate) but make reassembly fail. So do not allow updating the meta-data after we have seen the first fragmented part anymore. The frag6_20 test case is added which failed before triggering an ICMPv6 "param prob" due to the check for each queued fragment for a max-size violation if a fragoff=0 packet was received. MFC after: 3 weeks Sponsored by: Netflix Notes: svn path=/head/; revision=354053