aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Extend support for ptrace() tests using breakpoints.John Baldwin2018-04-241-13/+35
| | | | | | | | | | | | | | | | | | | - Use a single list of platforms to define HAVE_BREAKPOINT for platforms that expose a functional breakpoint() inline to userland. Replace existing lists of platform tests with HAVE_BREAKPOINT instead. - Add support for advancing PC past a breakpoint inserted via breakpoint() to support the existing ptrace__PT_CONTINUE_different_thread test on non-x86 platforms (x86 advances the PC past the breakpoint instruction, but other platforms do not). This is implemented by defining a new SKIP_BREAK macro which accepts a pointer to a 'struct reg' as its sole argument and modifies the contents to advance the PC. The intention is to use it in between PT_GETREGS and PT_SETREGS. Tested on: amd64, i386, mips (after adding a breakpoint() to mips) MFC after: 1 month Notes: svn path=/head/; revision=332906
* Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GETKonstantin Belousov2018-04-202-14/+14
| | | | | | | | | | | | -> PROC_PDEATHSIG_STATUS for consistency with other procctl(2) operations names. Requested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 13 days Notes: svn path=/head/; revision=332825
* Add PROC_PDEATHSIG_SET to procctl interface.Konstantin Belousov2018-04-183-0/+395
| | | | | | | | | | | | | Allow processes to request the delivery of a signal upon death of their parent process. Supposed consumer of the feature is PostgreSQL. Submitted by: Thomas Munro Reviewed by: jilles, mjg MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15106 Notes: svn path=/head/; revision=332740
* Properly do a deep copy of the ioctls capability array for fget_cap().John Baldwin2018-04-173-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Reviewed by: kib Discussed with: mjg (not a fan of the extra branch) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15047 Notes: svn path=/head/; revision=332657
* lio_listio: return EAGAIN instead of EIO when out of resourcesAlan Somers2018-04-162-0/+73
| | | | | | | | | | | This behavior is already documented by the man page, and suggested by POSIX. Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15099 Notes: svn path=/head/; revision=332631
* [tests] change tests/sys/acl/run to run on perl 5.26Eitan Adler2018-04-111-1/+1
| | | | | | | | Previously unescaped regex just resulted in a warning. Now it results in a failed test. Notes: svn path=/head/; revision=332399
* pf tests: Do not build or install if pf is not enabledKristof Provost2018-04-101-0/+4
| | | | | | | | | | Do not build or install pf tests if WITHOUT_PF is set. This fixes the build failure with WITHOUT_PF=yes. Reported by: Vladimir Zakharov <zakharov.vv@gmail.com> Notes: svn path=/head/; revision=332358
* pf tests: Basic ioctl validationKristof Provost2018-04-061-0/+297
| | | | | | | | | | | Basic validation tests for DIOCRADDADDRS, DIOCRDELADDRS, DIOCRSETADDRS, DIOCRGETADDRS, DIOCRGETASTATS, DIOCRCLRASTATS, DIOCRTSTADDRS, DIOCRINADEFINE, DIOCXBEGIN and DIOCXROLLBACK. MFC after: 1 week Notes: svn path=/head/; revision=332143
* pf tests: Try to provoke a memory leakKristof Provost2018-04-061-0/+9
| | | | | | | | | | | There was a memory leak in the DIOCRADDTABLES ioctl() code which could be triggered by trying to add tables with the same name. Try to provoke this memory leak. It was fixed in r331225. MFC after: 1 week Notes: svn path=/head/; revision=332139
* pf tests: Basic ioctl validation for DIOCIGETIFACES and DIOCXCOMMITKristof Provost2018-04-061-0/+59
| | | | | | | | | Validate the DIOCIGETIFACES and DIOCXCOMMIT ioctls with invalid values. MFC after: 1 week Notes: svn path=/head/; revision=332137
* pf tests: Basic ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, ↵Kristof Provost2018-04-061-0/+138
| | | | | | | | | | | | | | DIOCRCLRTSTATS and DIOCRSETTFLAGS Validate the DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS ioctls with invalid values. These may succeed (because the kernel uses the minimally required size, not the specified size), but should not trigger kernel panics. MFC after: 1 week Notes: svn path=/head/; revision=332108
* pf tests: Basic ioctl validation testsKristof Provost2018-04-063-0/+141
| | | | | | | | | | Validate the DIOCRADDTABLES and DIOCRDELTABLES ioctls with invalid size values. All of these requests should fail. MFC after: 1 week Notes: svn path=/head/; revision=332102
* ZFS test suite: fix uses of illumos /dev/[r]dsk/ and /dev/zvol/[r]dsk/Andriy Gapon2018-03-2734-66/+66
| | | | Notes: svn path=/head/; revision=331613
* Import Blake2 algorithms (blake2b, blake2s) from libb2Conrad Meyer2018-03-213-0/+16686
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream repository is on github BLAKE2/libb2. Files landed in sys/contrib/libb2 are the unmodified upstream files, except for one difference: secure_zero_memory's contents have been replaced with explicit_bzero() only because the previous implementation broke powerpc link. Preferential use of explicit_bzero() is in progress upstream, so it is anticipated we will be able to drop this diff in the future. sys/crypto/blake2 contains the source files needed to port libb2 to our build system, a wrapped (limited) variant of the algorithm to match the API of our auth_transform softcrypto abstraction, incorporation into the Open Crypto Framework (OCF) cryptosoft(4) driver, as well as an x86 SSE/AVX accelerated OCF driver, blake2(4). Optimized variants of blake2 are compiled for a number of x86 machines (anything from SSE2 to AVX + XOP). On those machines, FPU context will need to be explicitly saved before using blake2(4)-provided algorithms directly. Use via cryptodev / OCF saves FPU state automatically, and use via the auth_transform softcrypto abstraction does not use FPU. The intent of the OCF driver is mostly to enable testing in userspace via /dev/crypto. ATF tests are added with published KAT test vectors to validate correctness. Reviewed by: jhb, markj Obtained from: github BLAKE2/libb2 Differential Revision: https://reviews.freebsd.org/D14662 Notes: svn path=/head/; revision=331312
* Appease GCC 4.2Conrad Meyer2018-03-211-1/+1
| | | | | | | | | | It mistakenly believes the 'static' keyword must come first. Fix PPC, Sparc64, and maybe MIPS world. Fallout from r331279. Reported by: tinderbox (results come slowly) Notes: svn path=/head/; revision=331284
* Implement getrandom(2) and getentropy(3)Conrad Meyer2018-03-212-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The general idea here is to provide userspace programs with well-defined sources of entropy, in a fashion that doesn't require opening a new file descriptor (ulimits) or accessing paths (/dev/urandom may be restricted by chroot or capsicum). getrandom(2) is the more general API, and comes from the Linux world. Since our urandom and random devices are identical, the GRND_RANDOM flag is ignored. getentropy(3) is added as a compatibility shim for the OpenBSD API. truss(1) support is included. Tests for both system calls are provided. Coverage is believed to be at least as comprehensive as LTP getrandom(2) test coverage. Additionally, instructions for running the LTP tests directly against FreeBSD are provided in the "Test Plan" section of the Differential revision linked below. (They pass, of course.) PR: 194204 Reported by: David CARLIER <david.carlier AT hardenedbsd.org> Discussed with: cperciva, delphij, jhb, markj Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D14500 Notes: svn path=/head/; revision=331279
* Revert r318180 and re-enable AIO tests on md(4) by default.John Baldwin2018-03-191-1/+0
| | | | | | | | | | | | | | | | | The 'physio' fast-path used by AIO requests on md(4) devices, is not gated on the unsafe_aio knob. Prior to r327755, some AIO requests could fail the fast-path and fall back to the slow-path (requests for devices not supporting unmapped I/O and requests which failed with EFAULT during the fast-path). However, those cases now return a suitable error rather than using the slow-path. PR: 217261 Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14742 Notes: svn path=/head/; revision=331221
* aio_kqueue_test: fix the build when DEBUG=1Alan Somers2018-03-171-3/+10
| | | | | | | Also, make the debug output more verbose Notes: svn path=/head/; revision=331104
* aio: add an ATF test case for aio_fsync error conditionsAlan Somers2018-03-171-0/+37
| | | | Notes: svn path=/head/; revision=331103
* zfs test suite: move definition of DISK to the cfg file in zpool_getAndriy Gapon2018-03-152-1/+2
| | | | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. Another one that should have been in r331001. Notes: svn path=/head/; revision=331004
* zfs test suite: add new pool properties / features to the zpool_get listAndriy Gapon2018-03-151-0/+3
| | | | Notes: svn path=/head/; revision=331003
* zfs test suite: move definition of DISK to the cfg file in zpool_getAndriy Gapon2018-03-152-2/+2
| | | | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. This should have been in r331001. Notes: svn path=/head/; revision=331002
* zfs test suite: move definition of DISK to the cfg file in zpool_exportAndriy Gapon2018-03-152-2/+2
| | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. Notes: svn path=/head/; revision=331001
* zfs test suite: support device paths with intermediate directoriesAndriy Gapon2018-03-153-7/+3
| | | | | | | | | The code assumed that disks (devices) used for testing are always named like /dev/foo, but there is no reason for that restriction and we can easily support paths like /dev/stripe/bar. Notes: svn path=/head/; revision=330996
* zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2Andriy Gapon2018-03-151-1/+1
| | | | Notes: svn path=/head/; revision=330995
* zfs test suite: destroy old gnops before creating new onesAndriy Gapon2018-03-151-0/+1
| | | | Notes: svn path=/head/; revision=330994
* zfs test suite: align zfs_destroy_005_neg: with upstreamAndriy Gapon2018-03-151-3/+33
| | | | | | | | | | The change is to account for a different order in which the recursive destroy may be attempted. If we first try a dataset that can be destroyed then it will be destroyed, but if we first try a dataset that cannot be destroyed then we will not attempt to destroy the other dataset. Notes: svn path=/head/; revision=330993
* zfs test suite: fix a typo, da0 vs $diskAndriy Gapon2018-03-151-1/+1
| | | | Notes: svn path=/head/; revision=330992
* re-enable zfs_copies_006_pos test after a fix in r330977Andriy Gapon2018-03-151-1/+0
| | | | | | | | | The test was disabled in r329408. PR: 225960 Notes: svn path=/head/; revision=330979
* re-enable zpool_upgrade_007_pos test after the fix in r330974Andriy Gapon2018-03-151-1/+0
| | | | | | | | | The test was disabled in r329248. PR: 225877 Notes: svn path=/head/; revision=330975
* Add tests for lagg(4) and other cloned network interfacesAlan Somers2018-02-234-0/+1061
| | | | | | | | | | | Unfortunately, most of the tests are disabled because they fairly frequently trigger panics. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329874
* Add the ZFS test suiteAlan Somers2018-02-231504-0/+139089
| | | | | | | | | | | | | | | | | It was originally written by Sun as part of the STF (Solaris test framework). They open sourced it in OpenSolaris, then HighCloud partially ported it to FreeBSD, and Spectra Logic finished the port. We also added many testcases, fixed many broken ones, and converted them all to the ATF framework. We've had help along the way from avg, araujo, smh, and brd. By default most of the tests are disabled. Set the disks Kyua variable to enable them. Submitted by: asomers, will, justing, ken, brd, avg, araujo, smh Sponsored by: Spectra Logic Corp, HighCloud Notes: svn path=/head/; revision=329867
* gpart: append partition name to the underlying provider's physical pathAlan Somers2018-02-143-2/+198
| | | | | | | | | | | | | 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 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14010 Notes: svn path=/head/; revision=329275
* geli: append "/eli" to the underlying provider's physical pathAlan Somers2018-02-142-0/+178
| | | | | | | | | | | | | 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 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13979 Notes: svn path=/head/; revision=329273
* Fix and enable SysV IPC tests.Brooks Davis2018-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=328896
* Mark the unused argument to continue_thread() as such.John Baldwin2018-01-241-1/+1
| | | | | | | clang in HEAD and 11 does not warn about this, but clang in 10 does. Notes: svn path=/head/; revision=328344
* Add ccp(4): experimental driver for AMD Crypto Co-ProcessorConrad Meyer2018-01-181-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Registers TRNG source for random(4) * Finds available queues, LSBs; allocates static objects * Allocates a shared MSI-X for all queues. The hardware does not have separate interrupts per queue. Working interrupt mode driver. * Computes SHA hashes, HMAC. Passes cryptotest.py, cryptocheck tests. * Does AES-CBC, CTR mode, and XTS. cryptotest.py and cryptocheck pass. * Support for "authenc" (AES + HMAC). (SHA1 seems to result in "unaligned" cleartext inputs from cryptocheck -- which the engine cannot handle. SHA2 seems to work fine.) * GCM passes for block-multiple AAD, input lengths Largely based on ccr(4), part of cxgbe(4). Rough performance averages on AMD Ryzen 1950X (4kB buffer): aesni: SHA1: ~8300 Mb/s SHA256: ~8000 Mb/s ccp: ~630 Mb/s SHA256: ~660 Mb/s SHA512: ~700 Mb/s cryptosoft: ~1800 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/s As you can see, performance is poor in comparison to aesni(4) and even cryptosoft (due to high setup cost). At a larger buffer size (128kB), throughput is a little better (but still worse than aesni(4)): aesni: SHA1:~10400 Mb/s SHA256: ~9950 Mb/s ccp: ~2200 Mb/s SHA256: ~2600 Mb/s SHA512: ~3800 Mb/s cryptosoft: ~1750 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/s AES performance has a similar story: aesni: 4kB: ~11250 Mb/s 128kB: ~11250 Mb/s ccp: ~350 Mb/s 128kB: ~4600 Mb/s cryptosoft: ~1750 Mb/s 128kB: ~1700 Mb/s This driver is EXPERIMENTAL. You should verify cryptographic results on typical and corner case inputs from your application against a known- good implementation. Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12723 Notes: svn path=/head/; revision=328150
* gnop(8): add the ability to set a nop provider's physical pathAlan Somers2018-01-181-6/+109
| | | | | | | | | | While I'm here, expand the existing tests a bit. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13579 Notes: svn path=/head/; revision=328108
* Add regression tests for r327779.Mark Johnston2018-01-102-0/+112
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327780
* Remove the executable bit from some recently added test scripts.Mark Johnston2018-01-108-0/+0
| | | | Notes: svn path=/head/; revision=327769
* pf tests: Fix pft_ping.py to work with scapy 2.3.3Kristof Provost2018-01-091-1/+1
| | | | | | | | Scapy requires the Raw payload to be a string, which was not the case. This caused the pft_ping.py script to fail, which in turn caused the test to fail. Notes: svn path=/head/; revision=327735
* geli: optimize testsAlan Somers2018-01-083-17/+32
| | | | | | | | | | | | | | | | 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 after: 2 weeks Notes: svn path=/head/; revision=327685
* geli: convert remaining TAP tests to ATFAlan Somers2018-01-079-166/+203
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327683
* Fix typo from r327666Alan Somers2018-01-071-1/+1
| | | | | | | | MFC after: 13 days X-MFC-With: 327666 Notes: svn path=/head/; revision=327682
* geli: fix parallel execution of testsAlan Somers2018-01-073-42/+38
| | | | | | | | | | | 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. MFC after: 2 weeks Notes: svn path=/head/; revision=327666
* geli: convert most tests from TAP to ATFAlan Somers2018-01-0725-1413/+1124
| | | | | | | | | | | | | 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 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13717 Notes: svn path=/head/; revision=327662
* geli: fix the resize test on arm64Alan Somers2017-12-291-8/+7
| | | | | | | | | | | | | 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 MFC after: 2 weeks Notes: svn path=/head/; revision=327353
* Fix a harmless typo from r310786Alan Somers2017-12-291-1/+1
| | | | | | | | | I copy/pasted a reference to an undefined shell variable. MFC after: 2 weeks Notes: svn path=/head/; revision=327352
* geli: factor out some common code in the geli testsAlan Somers2017-12-298-31/+12
| | | | | | | | | | No functional change. MFC after: 2 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=327347
* Fix potential TOCTTOU bug in the geli testsAlan Somers2017-12-2922-290/+288
| | | | | | | | | | | | | | | 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 MFC after: 2 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13666 Notes: svn path=/head/; revision=327346