summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Handle the difference between HEAD and stable/11 tests build.kib2018-05-151-0/+1
| | | | | | | | | This is a direct commit to stable/11. PR: 228018, 228233 Tested by: Helge Oldach <freebsd@oldach.net> Sponsored by: The FreeBSD Foundation Approved by: re (marius)
* MFC r332740:kib2018-05-023-0/+389
| | | | | | | | | | Add PROC_PDEATHSIG_SET to procctl interface. MFC r332825: Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL. MFC r333067: Remove redundant pipe from pdeathsig.c test.
* MFC 332657:jhb2018-04-273-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly do a deep copy of the ioctls capability array for fget_cap(). fget_cap() tries to do a cheaper snapshot of a file descriptor without holding the file descriptor lock. This snapshot does not do a deep copy of the ioctls capability array, but instead uses a different return value to inform the caller to retry the copy with the lock held. However, filecaps_copy() was returning 1 to indicate that a retry was required, and fget_cap() was checking for 0 (actually '!filecaps_copy()'). As a result, fget_cap() did not do a deep copy of the ioctls array and just reused the original pointer. This cause multiple file descriptor entries to think they owned the same pointer and eventually resulted in duplicate frees. The only code path that I'm aware of that triggers this is to create a listen socket that has a restricted list of ioctls and then call accept() which calls fget_cap() with a valid filecaps structure from getsock_cap(). To fix, change the return value of filecaps_copy() to return true if it succeeds in copying the caps and false if it fails because the lock is required. I find this more intuitive than fixing the caller in this case. While here, change the return type from 'int' to 'bool'. Finally, make filecaps_copy() more robust in the failure case by not copying any of the source filecaps structure over. This avoids the possibility of leaking a pointer into a structure if a similar future caller doesn't properly handle the return value from filecaps_copy() at the expense of one more branch. I also added a test case that panics before this change and now passes.
* MFC r329874:asomers2018-04-164-0/+1061
| | | | | | | | | Add tests for lagg(4) and other cloned network interfaces Unfortunately, most of the tests are disabled because they fairly frequently trigger panics. Sponsored by: Spectra Logic Corp
* MFC r329273, r329275, r329277, r329284, r329344asomers2018-03-105-2/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r329273: geli: append "/eli" to the underlying provider's physical path If the underlying provider's physical path is null, then the geli device's physical path will be, too. Otherwise, it will append "/eli". This will make geli work better with zfsd(8). PR: 224962 Differential Revision: https://reviews.freebsd.org/D13979 r329275: gpart: append partition name to the underlying provider's physical path If the underlying provider's physical path is null, then the gpart device's physical path will be, too. Otherwise, it will append the partition name, such as "/p1" or "/s1/a". This will make gpart work better with zfsd(8). PR: 224965 Differential Revision: https://reviews.freebsd.org/D14010 r329277: Add mtree entry for 329275 X-MFC-With: 329275 Sponsored by: Spectra Logic Corp r329284: zfsd: Allow zfsd to work on any type of GEOM provider cddl/usr.sbin/zfsd/zfsd_event.cc Remove the check for da and ada devices. This way zfsd can work on md, geli, glabel, gstripe, etc devices. geli in particular is useful combined with ZFS. gnop is also useful for simulating drive pulls in the ZFSD test suite. Also, eliminate the DevfsEvent class entirely. Move its responsibilities into GeomEvent. We can get everything we need to know just from listening to GEOM events. lib/libdevdctl/event.cc Fix GeomEvent::DevName for CREATE events. Oddly, the relevant field is named "cdev" for CREATE events but "devname" for disk events. Relnotes: Yes (probably worth mentioning the geli part) Sponsored by: Spectra Logic Corp r329344: Optimize zfsd for the happy case If there are no damaged pools, then ignore all GEOM events. We only use them to fix damaged pools. However, still pay attention to ZFS events. X-MFC-With: 329284 Sponsored by: Spectra Logic Corp
* MFC r328896, r329236asomers2018-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r328896: Fix and enable SysV IPC tests. Don't declare some types that FreeBSD incorrectly declares. Fix an incorrect call to open() (missing mode). ANSIfy prototypes. Enable SysV message queue, semaphore, and shared memory tests. With exception of the workaround for union semun, these fixes have been committed to NetBSD. Reviewed by: asomers Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13471 r329236: Fix Coverity CIDs in the sys/kern/sysv_test tests CID 979810: strcpy => strlcpy CID 1193367: don't leak a file descriptor CID 1299856: Check the return value of read(2) Reported by: Coverity Coverity CID: 978910 1193367 1299856 X-MFC-With: 328896 Sponsored by: Spectra Logic Corp
* MFC r319590:eadler2018-03-011-3/+3
|
* MFC r328108:asomers2018-02-221-6/+109
| | | | | | | | gnop(8): add the ability to set a nop provider's physical path While I'm here, expand the existing tests a bit. Differential Revision: https://reviews.freebsd.org/D13579
* MFC 319454: Honor the requested crid when running a test.jhb2018-02-081-4/+1
| | | | | | Otherwise, the kernel is free to choose an aribtrary crypto device rather than the requested device subverting tests that force the use of a specific device.
* MFC geli test suite changesasomers2018-02-0227-1626/+1363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r306188, r306395, r327346-r327347, r327352-r327353, r327662, r327666, r327682-r327683, r327685 r306188 by br: Use bsdlabel as we don't have hardlink disklabel -> bsdlabel on some platforms. Reviewed by: ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D7968 r306395 by br: Increase timeouts for geli tests. It takes 2-3x more time to proceed the tests on MIPS64EB in QEMU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 r327346: Fix potential TOCTTOU bug in the geli tests This change mostly reverts r293436, which introduced the bug due to a belief that geli(8) would allocate md(4) devices by itself. However, that belief is incorrect. Instead of using linear probing to find available md(4) numbers, it's best to use the existing attach_md function. Reviewed by: ngie Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13666 r327347: geli: factor out some common code in the geli tests No functional change. Sponsored by: Spectra Logic Corp r327352: Fix a harmless typo from r310786 I copy/pasted a reference to an undefined shell variable. r327353: geli: fix the resize test on arm64 The resize test used bsdlabel(8), which is not available on all architectures. Change it to use gpart(8) instead, which should be available everywhere. PR: 221763 Reported by: andrew r327662: geli: convert most tests from TAP to ATF I'm leaving readonly_test and nokey_test alone for now. In a future commit they should be broken up into several smaller test cases and distributed between multiple files. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D13717 r327666: geli: fix parallel execution of tests The trick is not to destroy an md(4) device during a test. That can create a "double-free" situation, because we also destroy md devices during test cleanup. r327682: Fix typo from r327666 X-MFC-With: 327666 r327683: geli: convert remaining TAP tests to ATF r327685: geli: optimize tests Reduce the geli tests' runtime by about a third: * In integrity_test:copy, use a file-backed md(4) device instead of a malloc'd one. That way we can corrupt the underlying storage without needing to detach and reattach the geli device. * In integrity_test:{copy, hmac, data} and onetime_test:{onetime, onetime_a}, move reads of /dev/random out of the loop.
* MFC 325028,328344: Discard the correct thread event reported for a ptrace stop.jhb2018-01-241-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 325028: Discard the correct thread event reported for a ptrace stop. When multiple threads wish to report a tracing event to a debugger, both threads call ptracestop() and one thread will win the race to be the reporting thread (p->p_xthread). The debugger uses PT_LWPINFO with the process ID to determine which thread / LWP is reporting an event and the details of that event. This event is cleared as a side effect of the subsequent ptrace event that resumed the process (PT_CONTINUE, PT_STEP, etc.). However, ptrace() was clearing the event identified by the LWP ID passed to the resume request even if that wasn't the 'p_xthread'. This could result in clearing an event that had not yet been observed by the debugger and leaving the existing event for 'p_thread' pending so that it was reported a second time. Specifically, if the debugger stopped due to a software breakpoint in one thread, but then switched to another thread that was used to resume (e.g. if the user switched to a different thread and issued a step), the resume request (PT_STEP) cleared a pending event (if any) for the thread being stepped. However, the process immediately stopped and the first thread reported it's breakpoint event a second time. The debugger decremented the PC for "both" breakpoint events which resulted in the PC now pointing into the middle of an instruction (on x86) and a SIGILL fault when the process was resumed a second time. To fix, always clear the pending event for 'p_xthread' when resuming a process. ptrace() still honors the requested LWP ID when enabling single-stepping (PT_STEP) or setting a different PC (PT_CONTINUE). 328344: Mark the unused argument to continue_thread() as such. clang in HEAD and 11 does not warn about this, but clang in 10 does.
* MFC r327779, r327780:markj2018-01-242-0/+112
| | | | Fix handling of read errors during synchronization.
* MFC 326953:jhb2018-01-241-1/+6
| | | | | | | | | | | | Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies. Some of the ptrace tests need to wait for a child process to become a zombie before preceding. The parent process polls the child process via the kern.proc.pid sysctl to wait for it to become a zombie. Previously the code polled until the sysctl failed with ESRCH. Now it will poll until either the sysctl fails with ESRCH (for compatiblity with older kernels) or returns a kinfo_proc structure with the ki_stat field set to SZOMB.
* MFC r315292asomers2018-01-121-1/+1
| | | | | | | | | r315292 (by glebius) Fix buildworld broken in r315230 when /sys doesn't point into a right source tree. Usage of SYSDIR is apparently wrong here. Discussed with: allanjude
* MFC r313962, r313972-r313973, r315230asomers2018-01-124-0/+1260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313962 by allanjude: improve PBKDF2 performance The PBKDF2 in sys/geom/eli/pkcs5v2.c is around half the speed it could be GELI's PBKDF2 uses a simple benchmark to determine a number of iterations that will takes approximately 2 seconds. The security provided is actually half what is expected, because an attacker could use the optimized algorithm to brute force the key in half the expected time. With this change, all newly generated GELI keys will be approximately 2x as strong. Previously generated keys will talk half as long to calculate, resulting in faster mounting of encrypted volumes. Users may choose to rekey, to generate a new key with the larger default number of iterations using the geli(8) setkey command. Security of existing data is not compromised, as ~1 second per brute force attempt is still a very high threshold. PR: 202365 Original Research: https://jbp.io/2015/08/11/pbkdf2-performance-matters/ Submitted by: Joe Pixton <jpixton@gmail.com> (Original Version), jmg (Later Version) Reviewed by: ed, pjd, delphij Approved by: secteam, pjd (maintainer) Differential Revision: https://reviews.freebsd.org/D8236 r313972 by ngie: Unbreak the build when "make obj" is executed beforehand Using relative paths imply working directory (in this case .OBJDIR), whereas the sources live in the .CURDIR-relative path. X-MFC with: r313962 Pointyhat to: allanjude Sponsored by: Dell EMC Isilon r313973 by ngie: A forced commit to note other portion of the Makefile change accidentally committed in r313972 The code committed in r313962 implicitly relies on python 2.x to generate testvect.h . There are a handful of issues with this approach: - python is not an explicit build dependency for FreeBSD - python 2.x is deprecated and will be removed sometime in the future (potentially before 11.x's EOL), and the script does not function with python 3.5 (it uses deprecated idioms and incompatible function calls). - python(1) (by default) lives in /usr/local/bin (${LOCALBASE}/bin) and gentestvect.py is a dependency of testvect.h (prior to r313972) which means that if the mtime of the generator script was newer than the mtime of the test vector, it could cause a spurious build failure in build time or at install time. A better solution using C/C++ should be devised. Discussed with: allanjude X-MFC with: r313962, r313972 Sponsored by: Dell EMC Isilon r315230 by ngie: Move .../sys/geom/eli/pbkdf2... to .../sys/geom/class/eli/... This change moves the tests added in r313962 to an existing directory structure used by the geli TAP tests. It also, renames the test from pbkdf2 to pbkdf2_test . The changes to ObsoleteFiles.inc are being committed separately as they aren't needed for the MFC to ^/stable/11, etc, if the MFC for the tests is done all in one commit. X-MFC with: r313962, r313972-r313973 Reviewed by: allanjude Sponsored by: Dell EMC Isilon Differential Revision: D9985
* MFC r326861-r326863:markj2018-01-049-13/+331
| | | | Add some gmirror tests and fix indentation in existing tests.
* MFC r326877:markj2017-12-221-0/+11
| | | | Skip gnop tests if the corresponding kernel module isn't available.
* MFC r325817, r325827asomers2017-12-082-31/+43
| | | | | | | | | | | | | | | | | | | | | | | r325817: AIO tests: increase limits tests/sys/aio/aio_kqueue_test.c Instead of using a hard-coded queue depth, use vfs.aio.max_aio_queue_per_proc tests/sys/aio/lio_kqueue_test.c The old, small limit on lio_listio's operation count was lifted by change 324941. Raise the operation count as high as possible without exceeding the process's operation limit. Sponsored by: Spectra Logic Corp r325827: Fix build on arm after r325817 Reported by: rpokala X-MFC-With: 325817 Sponsored by: Spectra Logic Corp
* MFC 324993:jhb2017-11-161-0/+87
| | | | Add a test for sending a signal while stepping a thread via PT_STEP.
* MFC r318246,r324566,r324668,r324701:bdrewery2017-10-241-9/+344
| | | | | | | | | | | r318246: Add a regression test for r318191. r324566: Fix shadowed variable hidden by WARNS changing to 3 in r313006. r324668: This child is expected to exit on SIGTRAP, don't leave a core behind. r324701: Add a test for r324671 along with some other masked tests.
* MFC r324478:ngie2017-10-171-17/+16
| | | | | | | | | | | | | | Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output ^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e., ensure that the exit code is either 0 or 7. The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made the issue apparent -- thus this needs to be fixed independent of ^/head@r323923. PR: 222780 MFC with: r323923
* MFC note: tests/sys/kern/coredump_phnum_test.sh changes omittedngie2017-10-0719-0/+0
| | | | | | | | | MFC r322214: Make test scripts under tests/... non-executable Executable bits should be set at install time instead of in the repo. Setting executable bits on files triggers false positives with Phabricator.
* MFC r317713:ngie2017-10-073-0/+117
| | | | | | r317713 (by markj): Add regression tests for r317712 and r306743.
* MFC r321702,r321703:ngie2017-09-081-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | r321702: Load geom_gate(4) if necessary before running tests; skip if it can't be loaded The test code prior to r311893 loaded geom_gate at test start if necessary and skipped the tests if it couldn't be loaded. The ATF-ifcation of this test done in r311893 unfortunately dropped this functionality. This change restores the geom_gate module load and skips the test(s) if unavailable in an ATF-like way. PR: 220164 r321703: Remove superfluous `exit 0` added in r321702 atf_skip triggers equivalent functionality, which means the `exit 0` is unreachable code. PR: 220164 MFC with: r321702
* MFC r322255:asomers2017-09-071-0/+6
| | | | | | | | | | | tests/sys/netinet/fibs_test: skip selected tests when firewalls are enabled Some tests send packets over epair(4) interfaces. Firewalls can cause spurious failures. Reviewed by: ngie Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11917
* MFC r316397 (by bde):rlibby2017-09-051-1/+1
| | | | | | | | | Remove the unportable -msse4 here too after fixing crc32_sse42.c to not depend on it. This should have been part of r315983. Note, r315983 was MFC'd to stable/11 in r317149. Approved by: markj (mentor)
* MFC r321332:asomers2017-08-251-2/+2
| | | | | | | | | | | Implement SIGEV_THREAD notifications for lio_listio(2) Our man pages have always indicated that this was supported, but in fact the feature was never implemented for lio_listio(2). Reviewed by: jhb, kib (earlier version) Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11680
* MFC r321082:asomers2017-08-252-0/+148
| | | | | | | | | | | | | Add regression tests for bugs 220459 and 220398 Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0 Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD PR: 220459 PR: 220398 Reviewed by: cem, jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11470
* MFC r320974-r320975, r321001, r321206asomers2017-08-252-296/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r320974: Use ATF cleanup routines in aio_test.c Remove aio_test's legacy timeout handling and cleanup routines. Instead, use ATF's builtin capabilities. ATF automatically cleans up newly created files, too, so we don't have to explicitly unlink them. The only tests than need a cleanup routine are the md(4) tests, which must destroy their md device. Reviewed by: jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 r320975: Add tests for aio(4) completion notification via signals and threads Reviewed by: jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 r321001: Fix the build with GCC after r320975 Reported by: pfg X-MFC-With: 320975 Sponsored by: Spectra Logic Corp r321206: Remove dead code that was killed by r320975 Reported by: Coverity CID: 1377977 X-MFC-With: 320975 Sponsored by: Spectra Logic Corp
* MFC r321959:ngie2017-08-191-4/+25
| | | | | | Annotate tests that require root privileges appropriately This unbreaks running the tests with unprivileged users.
* MFC r320446:ngie2017-07-281-1/+1
| | | | | trailing_slash is a TAP-compliant testcase; mark it as such, instead of calling is a plain testcase.
* MFC r320445:ngie2017-07-281-2/+3
| | | | Don't hardcode path to file in /tmp; this violates the kyua sandbox
* MFC r319063:ngie2017-07-181-3/+6
| | | | | | | | | Send all of `data`, not just a portion of it It was sending only a long's worth (4 or 8 bytes) of data previously (instead of the entire buffer) via send(2). CID: 1229966, 1229967, 1230004, 1230005
* MFC r318180:ngie2017-07-171-0/+1
| | | | | | | | | | | | | | | Mark all md tests as requiring unsafe AIO in order to function These tests have been flapping (failing<->passing) on Jenkins for months. It passes reliably for me if unsafe AIO is permitted, but it doesn't pass on Jenkins reliably if unsafe AIO is disabled (the current default). Mark the tests as requiring unsafe AIO to mitigate the intermittent failures when unsafe AIO isn't permitted. If the kernel code is changed to reliably function with md(4) devices using unsafe AIO, this commit can be reverted. PR: 217261
* MFC r319455,r319456:ngie2017-07-102-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | r319455: Fix up `TEST_METADATA` - `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak trying to run the tests on a system without python installed in $PATH. - The tests require root because they load aesni(4) and/or cryptodev(4) if not already loaded. r319456: tests/sys/opencrypto/runtests: apply minor polish to test script - Refactor kld loading/unloading logic: -- Use a loop instead of an unrolled one. -- Check for the module being loaded before trying to load it, to reduce noise when loading modules that are already loaded. -- Don't mute stderr from kldload -- it could be potentially useful to the tester. -- In the event that the test script was terminated early, it would leave the modules still attached to the system (which is undesirable). Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the system is returned to its former operating state as best possible. Unload the modules in reverse order, in part for consistency and/or dependency reasons.
* MFC r312919 (by rwatson)asomers2017-06-021-8/+8
| | | | | | | | Fix build of aio_test on MIPS, where the compiler warns about the local variable 'err' shadowing the global function err(3). Which it does. Sponsored by: DARPA, AFRL Approved by: re
* MFC r317512:tuexen2017-06-012-1/+26
| | | | | | | | | armv8 has support for optional CRC32C instructions. This patch checks if they are available and if that is true make use of them. Thank you very much to Andrew Turner for providing help and review the patch! Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D10499
* MFC r319056,r319058,r319059,r319060,r319061,r319078:ngie2017-05-312-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r319056: tests/sys/file/ftruncate_test: use an exit code of 1 instead of -1 with err*(3). An exit code of -1 is implementation defined -- it's best to stick with something well-defined (1). r319058: Create a deterministic file in the kyua sandbox, instead of a temporary file outside the kyua sandbox This helps ensure that the file is removed at test exit, and as a side effect, cures a warning about umasks with Coverity. r319059: Use an exit code of 1 instead of -1 for reasons noted in r319056 r319060: Use main(void) instead of main(argc __unused, argv __unused) r319061: Don't leak accept_fd on thread completion CID: 1296068 r319078: Tweak r319058 slightly - Specify an explicit mode when using O_CREAT per open(2). - Fix the error message (add missing enclosing parentheses). MFC with: r319058
* MFC r319062:ngie2017-05-311-0/+1
| | | | | | Initial `srv` before using it in bind(2) CID: 1357526
* MFC r318593:asomers2017-05-302-10/+13
| | | | | | Fix build of AIO tests with -DDEBUG Also, redefine some constants for clarity. No functional change.
* MFC r312913,r318100,r318107:ngie2017-05-301-94/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | r312913 (by asomers): Improve the aio tests * Add tests for aio_suspend(2). * Add tests for polled completion notification. * Test the full matrix of file descriptor types and completion notification mechanisms. * Don't bother with mkstemp, because ATF runs every test in its own temp dir. * Fix some typos. * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls. r318100: style(9): move function definition curly braces to column 0 r318107: Remove unused constant (PATH_TEMPLATE) It was made unnecessary in r312913. MFC with: r312913
* MFC r318094,r318098,r318099:ngie2017-05-301-29/+44
| | | | | | | | | | | | | | | | r318094: style(9): clean up trailing whitespace r318098: Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO This is being done to reduce duplication between the two macros. r318099: Print out when unsafe AIO is enabled to debugging purposes
* MFC r318546:ngie2017-05-271-0/+3
| | | | | | | | | | | | | | | sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic The previous logic was flawed in the sense that it assumed that /dev/md3 was always available. This was a caveat I noted in r306038, that I hadn't gotten around to solving before now. Cache the device for the mountpoint after executing mdmfs, then use the cached value in basic_cleanup(..) when unmounting/disconnecting the md(4) device. Apply sed expressions to use reuse logic in the NetBSD code that could also be applied to FreeBSD, just with different tools.
* MFC r317566:brooks2017-05-051-10/+10
| | | | | | | | | | | | | Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF). These commands take an int. The tests work by accident on little-endian, 64-bit systems. PR: 218919 Tested with: qemu-cheri and CheriBSD built for mips64 Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL
* MFC r313006 (by cem), r315983 (by bde):markj2017-04-192-1/+139
| | | | Add an SSE4.2 implementation of crc32 for x86.
* MFC r313025, r313395, r314113, r314442, r315458, r315656asomers2017-04-172-87/+465
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313025: Add tests for multi-fib IPv6 routing PR: 196361 Submitted by: jhujhiti@adjectivism.org Reported by: Jason Healy <jhealy@logn.net> MFC after: 4 weeks Sponsored by: Spectra Logic Corp r313395: Add fibs_test:udp_dontroute6, another IPv6 multi-FIB test PR: 196361 MFC after: 3 weeks Sponsored by: Spectra Logic Corp r314113: Remove tests/sys/netinet/fibs_tests's dependency on net/socat Instead of bridging two tap interfaces with socat, just use an epair pair. MFC after: 3 weeks Sponsored by: Spectra Logic Corp r314442: Add an ATF test for IPv6 SLAAC with multiple fibs Tests that an interface can get a SLAAC address and that it inserts its routes into the correct fib. Does not test anything to do with NDP. PR: 196361 Reviewed by: Erick Turnquist <jhujhiti@adjectivism.org> MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9776 r315458: Constrain IPv6 routes to single FIBs when net.add_addr_allfibs=0 sys/netinet6/icmp6.c Use the interface's FIB for source address selection in ICMPv6 error responses. sys/netinet6/in6.c In in6_newaddrmsg, announce arrival of local addresses on the interface's FIB only. In in6_lltable_rtcheck, use a per-fib ND6 cache instead of a single cache. sys/netinet6/in6_src.c In in6_selectsrc, use the caller's fib instead of the default fib. In in6_selectsrc_socket, remove a superfluous check. sys/netinet6/nd6.c In nd6_lle_event, use the interface's fib for routing socket messages. In nd6_is_new_addr_neighbor, check all FIBs when trying to determine whether an address is a neighbor. Also, simplify the code for point to point interfaces. sys/netinet6/nd6.h sys/netinet6/nd6.c sys/netinet6/nd6_rtr.c Make defrouter_select fib-aware, and make all of its callers pass in the interface fib. sys/netinet6/nd6_nbr.c When inputting a Neighbor Solicitation packet, consider the interface fib instead of the default fib for DAD. Output NS and Neighbor Advertisement packets on the correct fib. sys/netinet6/nd6_rtr.c Allow installing the same host route on different interfaces in different FIBs. If rt_add_addr_allfibs=0, only install or delete the prefix route on the interface fib. tests/sys/netinet/fibs_test.sh Clear some expected failures, but add a skip for the newly revealed BUG217871. PR: 196361 Submitted by: Erick Turnquist <jhujhiti@adjectivism.org> Reported by: Jason Healy <jhealy@logn.net> Reviewed by: asomers MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9451 r315656: Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6 This test was failing if run twice because rtadvd takes too long to die. The rtadvd process from the first run was still running when the second run created its interfaces. The solution is to use SIGKILL during the cleanup instead of SIGTERM so rtadvd will die faster. While I'm here, randomize the addresses used for the test, which makes bugs like this easier to spot, and fix the cleanup order to be the opposite of the setup order PR: 217871 MFC after: 18 days X-MFC-With: 315458 Sponsored by: Spectra Logic Corp
* MFC r314056:asomers2017-04-021-7/+0
| | | | | | | | | | | | | Improve pjdfstest run instructions In the Kyua era, it's no longer necessary to set PJDFSTEST_TEST_PATH. Just use TMPDIR instead. Reviewed by: ngie MFC after: 3 weeks Relnotes: yes Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9340
* MFC r315412, r314852:badger2017-03-251-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315412: Don't clear p_ptevents on normal SIGKILL delivery The ptrace() user has the option of discarding the signal. In such a case, p_ptevents should not be modified. If the ptrace() user decides to send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events do not have the capability to discard the signal, so continue to clear the mask in that case. r314852: don't stop in issignal() if P_SINGLE_EXIT is set Suppose a traced process is stopped in ptracestop() due to receipt of a SIGSTOP signal, and is awaiting orders from the tracing process on how to handle the signal. Before sending any such orders, the tracing process exits. This should kill the traced process. But suppose a second thread handles the SIGKILL and proceeds to exit1(), calling thread_single(). The first thread will now awaken and will have a chance to check once more if it should go to sleep due to the SIGSTOP. It must not sleep after P_SINGLE_EXIT has been set; this would prevent the SIGKILL from taking effect, leaving a stopped orphan behind after the tracing process dies. Also add new tests for this condition. Sponsored by: Dell EMC
* MFC r313992, r314075, r314118, r315484:badger2017-03-252-0/+1163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315484: ptrace_test: eliminate assumption about thread scheduling A couple of the ptrace tests make assumptions about which thread in a multithreaded process will run after a halt. This makes the tests less portable across branches, and susceptible to future breakage. Instead, twiddle thread scheduling and priorities to match the tests' expectation. r314118: Actually fix buildworlds other than i386/amd64/sparc64 after r313992 Disable offending test for platforms without a userspace visible breakpoint(). r314075: Fix world build for archs where __builtin_debugtrap() does not work. The offending code was introduced in r313992. r313992: Defer ptracestop() signals that cannot be delivered immediately When a thread is stopped in ptracestop(), the ptrace(2) user may request a signal be delivered upon resumption of the thread. Heretofore, those signals were discarded unless ptracestop()'s caller was issignal(). Fix this by modifying ptracestop() to queue up signals requested by the ptrace user that will be delivered when possible. Take special care when the signal is SIGKILL (usually generated from a PT_KILL request); no new stop events should be triggered after a PT_KILL. Add a number of tests for the new functionality. Several tests were authored by jhb. PR: 212607 Sponsored by: Dell EMC
* MFC r313439,r314450:ngie2017-03-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313439: Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head The primary end-goal of this drop is ease future merges with NetBSD and collaborate further with the NetBSD project. The goal was (largely, not completely as some items are still oustanding in the NetBSD GNATS system) achieved by doing the following: - Pushing as many changes required to port contrib/netbsd-tests back to NetBSD as possible, then pull the upstream applied changes back in to FreeBSD. - Diff reduce with upstream where possible by: -- Improving libnetbsd header, etc compat glue. -- Using _SED variables to modify test scripts on the fly for items that could not be upstreamed to NetBSD. As a bonus for this work, this change also introduces testcases for uniq(1). Many thanks to Christos for working with me to get many of the changes back into the NetBSD project. In collaboration with: Christos Zoulas <christos@netbsd.org> r314450: Add additional __FreeBSD_version guards around the hsearch_r testcases The reasoning for this is the same as r276046: to ease MFCing the tests to ^/stable/10 . This was accidentally missed in r313439
OpenPOWER on IntegriCloud