aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix sys/netipsec/tunnel tests after r337736Alan Somers2018-08-171-4/+4
| | | | | | | | | | | | | Originally, these tests accidentally used broadcast addresses when they should've used unicast addresses. That the tests passed prior to r337736 was accidental. Submitted by: ae Reviewed by: olivier MFC after: 2 weeks Notes: svn path=/head/; revision=337984
* pf tests: Verify that pf limits the number of fragments per packetKristof Provost2018-08-171-0/+44
| | | | | | | | | Test the limitation on number of frames per packet introduced in pf in r337969. Sponsored by: Klara Systems Notes: svn path=/head/; revision=337971
* Add test cases for Poly1305 from RFC 7539Conrad Meyer2018-08-172-1/+405
| | | | Notes: svn path=/head/; revision=337941
* Fix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0Alan Somers2018-08-162-0/+14
| | | | | | | | | | | | | | Two of these testcases require software crypto to be enabled. Curiously, it isn't by default. PR: 230671 Reported by: Jenkins Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16755 Notes: svn path=/head/; revision=337933
* Revert r337929Alan Somers2018-08-169-15/+0
| | | | | | | | | | FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever since mkstemp was added in 1987. Coverity's warning is still relevant for portable programs since OpenGroup does not require that behavior, and POSIX didn't until 2008. But none of these programs are portable. Notes: svn path=/head/; revision=337930
* Fix Coverity warnings about mkstemp in testsAlan Somers2018-08-169-0/+15
| | | | | | | | | | | | | umask(2) should always be used prior to mkstemp(3) so the temporary file won't be created with insecure permissions. Reported by: Coverity CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060 CID: 1296057 1296062 MFC after: 2 weeks Notes: svn path=/head/; revision=337929
* Fix the sys/opencrypto/runtests test when aesni(4) is already loadedAlan Somers2018-08-161-2/+2
| | | | | | | | | | Apparently kldstat requires the full module name, including busname Reported by: Jenkins MFC after: 2 weeks Notes: svn path=/head/; revision=337911
* Fix a couple whitespace errors in r337814.David Bright2018-08-141-4/+4
| | | | | | | | | | Reported by: Renato Botelho <garga.bsd@gmail.com> MFC after: 3 days X-MFC-with: r337814 Sponsored by: Dell EMC Notes: svn path=/head/; revision=337820
* Fix several (more) memory leaks.David Bright2018-08-141-3/+14
| | | | | | | | | | | | | | A follow-up to r337812 to catch a couple more memory leaks that should have been included in that change. Reported by: Coverity CID: 1296064, 1296067 (for real this time) MFC after: 3 days X-MFC-with: r337812 Sponsored by: Dell EMC Notes: svn path=/head/; revision=337814
* Fix several memory leaks.David Bright2018-08-143-7/+21
| | | | | | | | | | | | | | | | | The libkqueue tests have several places that leak memory by using an idiom like: puts(kevent_to_str(kevp)); Rework to save the pointer returned from kevent_to_str() and then free() it after it has been used. Reported by: asomers (pointer to Coverity), Coverity CID: 1296063, 1296064, 1296065, 1296066, 1296067, 1350287, 1394960 Sponsored by: Dell EMC Notes: svn path=/head/; revision=337812
* pf tests: Basic test for 'set skip in $groupname'Kristof Provost2018-08-112-1/+38
| | | | | | | | | | This tests for the problem reported in PR 229241, where using a group name in 'set skip on' did not work as expected. Sponsored by: Essen Hackathon Notes: svn path=/head/; revision=337646
* Update PR 131876 regression tests after r337423.Mark Johnston2018-08-071-51/+153
| | | | | | | | | | | | | - Add some more cases to the truncation test. - Remove the "expect fail" annotations. PR: 131876 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16562 Notes: svn path=/head/; revision=337424
* Fix the regression test for PR 181741.Mark Johnston2018-08-041-18/+47
| | | | | | | | | | | | | | | With r337328, the test hangs becase the sendmsg() call will block until the receive buffer is at least partially drained. Fix the problem by using a non-blocking socket and allowing short writes. Also assert that a SCM_CREDS message was received if one was expected. PR: 181741 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16516 Notes: svn path=/head/; revision=337329
* Increase timeout for nop_test:stripesize.Ruslan Bukin2018-08-031-1/+1
| | | | | | | | | It takes 49s to complete this test in QEMU/RISC-V. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337237
* Fix LOCAL_PEERCRED with socketpair(2)Alan Somers2018-08-032-1/+78
| | | | | | | | | | | | | | Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2). PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16350 Notes: svn path=/head/; revision=337222
* Fix some nits in the unix_passfd tests.Mark Johnston2018-08-011-3/+4
| | | | | | | | | | | | - Remove return statements in functions with a void return type. - Allocate enough space for the SCM_CREDS and SCM_RIGHTS messages received in the rights_creds_payload test. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=337059
* Add a regression test related to PR 131876.Mark Johnston2018-07-311-0/+42
| | | | | | | | | | | | If an error occurs while copying a SCM_RIGHTS message to userspace, we free the mbuf containing externalized rights, leaking them. PR: 131876 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336957
* Correct possible misleading error message in kqtest.David Bright2018-07-301-5/+7
| | | | | | | | | | | | | | | | | | | | ian@ pointed out that in the test_abstime() function time(NULL) is used twice; once in an "if" test and again in the enclosed error message. If the true branch was taken and the process got preempted before the second time(NULL) call, by the time the error message was generated enough time could have elapsed that the message could claim that the event came "too early" but print an event time that was after the expected timeout. Correct by making the time(NULL) call only once and using that returned time in both the "if" test and the error message. Reported by: ian@ MFC after: 4 days X-MFC-with: r336761, r336781, r336802 Sponsored by: Dell EMC Notes: svn path=/head/; revision=336905
* audit(4): add tests for sysctl(3) and sysarch(2)Alan Somers2018-07-292-0/+235
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16116 Notes: svn path=/head/; revision=336875
* Fix compilation error on some arches after r336761 & r336781.David Bright2018-07-281-1/+1
| | | | | | | | | | | | | Another cast for printing an intmax_t was needed in a kqueue test for some arches. Pointy-hat: me (twice) MFC after: 1 week X-MFC-with: r336761, r336781 Sponsored by: Dell EMC Notes: svn path=/head/; revision=336802
* Fix compilation error on some arches after r336761.David Bright2018-07-271-1/+1
| | | | | | | | | | | | A cast for printing an intmax_t was needed in a kqueue test for some arches. MFC after: 1 week X-MFC-with: r336761 Sponsored by: Dell EMC Notes: svn path=/head/; revision=336781
* Allow a EVFILT_TIMER kevent to be updated.David Bright2018-07-273-10/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a timer is updated (re-added) with a different time period (specified in the .data field of the kevent), the new time period has no effect; the timer will not expire until the original time has elapsed. This violates the documented behavior as the kqueue(2) man page says (in part) "Re-adding an existing event will modify the parameters of the original event, and not result in a duplicate entry." This modification, adapted from a patch submitted by cem@ to PR214987, fixes the kqueue system to allow updating a timer entry. The kevent timer behavior is changed to: * When a timer is re-added, update the timer parameters to and re-start the timer using the new parameters. * Allow updating both active and already expired timers. * When the timer has already expired, dequeue any undelivered events and clear the count of expirations. All of these changes address the original PR and also bring the FreeBSD and macOS kevent timer behaviors into agreement. A few other changes were made along the way: * Update the kqueue(2) man page to reflect the new timer behavior. * Fix man page style issues in kqueue(2) diagnosed by igor. * Update the timer libkqueue system test to test for the updated timer behavior. * Fix the (test) libkqueue common.h file so that it includes config.h which defines various HAVE_* feature defines, before the #if tests for such variables in common.h. This enables the use of the actual err(3) family of functions. * Fix the usages of the err(3) functions in the tests for incorrect type of variables. Those were formerly undiagnosed due to the disablement of the err(3) functions (see previous bullet point). PR: 214987 Reported by: Brian Wellington <bwelling@xbill.org> Reviewed by: kib MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15778 Notes: svn path=/head/; revision=336761
* Introduce test program for auditpipe(4)Alan Somers2018-07-263-0/+196
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16395 Notes: svn path=/head/; revision=336728
* Temporarily disable the sys/acl/00 and sys/acl/02 testsAlan Somers2018-07-221-5/+7
| | | | | | | | | | | These tests are failing due to PR 229930. Unfortunately, TAP tests can't be marked as expected failures. PR: 229930 Reported by: Jenkins Notes: svn path=/head/; revision=336617
* Add a regression test for PR 131876.Mark Johnston2018-07-221-3/+71
| | | | | | | | PR: 131876 MFC after: 1 week Notes: svn path=/head/; revision=336614
* Fix audit of chflagsat, lgetfh, and setfibAlan Somers2018-07-223-18/+0
| | | | | | | | | | | | | | These syscalls were always supposed to have been auditted, but due to oversights never were. PR: 228374 Reported by: aniketp Reviewed by: aniketp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16388 Notes: svn path=/head/; revision=336604
* Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967Alan Somers2018-07-211-6/+0
| | | | | | | | | | | | In r321967 ngie "fixed" these tests by changing their expectations to match the device numbers produced by the new ino64 code. But it wasn't the tests that were broken, it was the kernel. bde fixed the kernel in r335053. Reported by: Jenkins MFC after: Never (only applies to >= 12) Notes: svn path=/head/; revision=336588
* Clear expected failures for aesni_aes_gcm testsAlan Somers2018-07-212-2/+0
| | | | | | | | | | | | These tests were fixed by r335584 PR: 228094 PR: 201447 MFC after: 2 weeks X-MFC-With: 335584 Notes: svn path=/head/; revision=336586
* audit(4): add test cases for chflagsat(2), lgetfh(2), setfib(2)Alan Somers2018-07-213-0/+159
| | | | | | | | | | | | | | These three syscalls aren't currently audited correctly, so the tests are marked as expected failures. PR: 228374 Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16379 Notes: svn path=/head/; revision=336580
* audit(4): add more test cases for auditon(2)Alan Somers2018-07-211-0/+224
| | | | | | | | | | | | | | | auditon(2) is an ioctl-like syscall with several different variants, each of which has a distinct audit event. This commit tests the remaining variants that weren't tested in r336564. Submitted by: aniketp MFC after: 2 weeks X-MFC-With: 336564 Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16381 Notes: svn path=/head/; revision=336579
* Separate the audit(4) tests for auditon(2)'s individual commandsAlan Somers2018-07-201-54/+526
| | | | | | | | | | | | | | auditon(2) is an ioctl-like syscall with several different variants, each of which has a distinct audit event. Write separate audit(4) tests for each variant. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16255 Notes: svn path=/head/; revision=336564
* audit(4): add tests for _exit(2), cap_enter(2), and cap_getmode(2)Alan Somers2018-07-172-0/+138
| | | | | | | | | | | | | | Also, fix a bug in common code that could cause other tests to fail: using ppoll(2) in combination with buffered I/O for /dev/auditpipe. Fix it by disabling buffering. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16099 Notes: svn path=/head/; revision=336418
* pf tests: Basic synproxy testKristof Provost2018-07-143-1/+68
| | | | | | | | A very basic syncproxy test: set up a connection via a synproxy rule. This triggeres the panic fixed in r336273. Notes: svn path=/head/; revision=336297
* Export a breakpoint() function to userland for arm and arm64.John Baldwin2018-07-061-3/+8
| | | | | | | | | | Enable ptrace() tests using breakpoint() on these architectures. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D15191 Notes: svn path=/head/; revision=336053
* audit(4): add tests for procctl(2)Alan Somers2018-07-011-0/+51
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16086 Notes: svn path=/head/; revision=335842
* audit(4): add tests for several more administrative syscallsAlan Somers2018-06-291-1/+467
| | | | | | | | | | | | | | | Includes ntp_adjtime, auditctl, acct, auditon, and clock_settime. Includes quotactl, mount, nmount, swapon, and swapoff in failure mode only. Success tests for those syscalls will follow. Also includes reboot(2) in failure mode only. That one can't be tested in success mode. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15898 Notes: svn path=/head/; revision=335792
* audit(4): add tests for setsid, wait4, wait6, and killAlan Somers2018-06-291-2/+230
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16035 Notes: svn path=/head/; revision=335791
* audit(4): fix Coverity issuesAlan Somers2018-06-273-3/+3
| | | | | | | | | | | | | | | | | | Fix several incorrect buffer size arguments and a file descriptor leak. Submitted by: aniketp Reported by: Coverity CID: 1393489 1393501 1393509 1393510 1393514 1393515 1393516 CID: 1393517 1393518 1393519 MFC after: 2 weeks X-MFC-With: 335284 X-MFC-With: 335318 X-MFC-With: 335320 Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16000 Notes: svn path=/head/; revision=335703
* audit(4): add tests for the process-control audit classAlan Somers2018-06-262-0/+1268
| | | | | | | | | | | | | | | | | | Tested syscalls include rfork(2), chdir(2), fchdir(2), chroot(2), getresuid(2), getresgid(2), setpriority(2), setgroups(2), setpgrp(2), setrlimit(2), setlogin(2), mlock(2), munlock(2), minherit(2), rtprio(2), profil(2), ktrace(2), ptrace(2), fork(2), umask(2), setuid(2), setgid(2), seteuid(2), and setegid(2). The last six are only tested in the success case, either because they're infalliable or a failure is difficult to cause on-demand. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15966 Notes: svn path=/head/; revision=335679
* audit(4): add tests for pipe, posix_openpt, shm_open, and shm_unlinkAlan Somers2018-06-261-1/+200
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15963 Notes: svn path=/head/; revision=335677
* audit(4): add tests for Sys V semaphore operationsAlan Somers2018-06-221-1/+697
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15897 Notes: svn path=/head/; revision=335528
* audit(4): add tests for sendmsg, recvmsg, shutdown, and sendfileAlan Somers2018-06-191-4/+294
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15895 Notes: svn path=/head/; revision=335378
* audit(4): add tests for utimes(2) and friends, mprotect, and undeleteAlan Somers2018-06-191-0/+267
| | | | | | | | | | | | | Includes utimes(2), futimes(2), lutimes(2), futimesat(2), mprotect(2), and undelete(2). undelete, for now, is tested only in failure mode. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15893 Notes: svn path=/head/; revision=335374
* audit(4): add tests for ioctl(2)Alan Somers2018-06-192-0/+106
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15872 Notes: svn path=/head/; revision=335354
* audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addrAlan Somers2018-06-181-1/+311
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15871 Notes: svn path=/head/; revision=335320
* audit(4): add tests for send, recv, sendto, and recvfromAlan Somers2018-06-181-63/+279
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15869 Notes: svn path=/head/; revision=335319
* audit(4): add tests for extattr_set_file and friendsAlan Somers2018-06-181-1/+346
| | | | | | | | | | | | | Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd, _delete_link} Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15867 Notes: svn path=/head/; revision=335318
* Fix 32-bit build after 335307Alan Somers2018-06-181-1/+1
| | | | | | | | | | | | | This was correct in the final version on Phabricator, but somehow I screwed up applying the patch locally. Reported by: linimon Pointy-hat-to: asomers MFC after: 2 weeks X-MFC-With: 335307 Notes: svn path=/head/; revision=335311
* audit(4): add tests for Sys V shared memory syscallsAlan Somers2018-06-171-2/+354
| | | | | | | | | | | | includes shmget, shmat, shmdt, and shmctl Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15860 Notes: svn path=/head/; revision=335307
* audit(4): add tests for connect, connectat, and acceptAlan Somers2018-06-171-5/+222
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15853 Notes: svn path=/head/; revision=335294