aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Use _exit() instead of exit() in child processes created during tests.John Baldwin2015-09-091-10/+10
| | | | | | | Suggested by: kib Notes: svn path=/head/; revision=287602
* Add a test to verify that a traced process sees its original parent viaJohn Baldwin2015-09-091-0/+87
| | | | | | | | | | getppid() after a debugger process that is not the parent has attached. Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D3615 Notes: svn path=/head/; revision=287601
* Properly size the children[] arrays in the follow fork tests.John Baldwin2015-09-091-6/+6
| | | | Notes: svn path=/head/; revision=287600
* Add more mmap tests related to character devices.John Baldwin2015-09-041-8/+103
| | | | | | | | | | | | | - Add cdev-related tests for bad args. - Add two simple tests cases for mapping /dev/zero that test for MAP_ANON-like behavior. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3323 Notes: svn path=/head/; revision=287448
* Add various tests to ensure that invalid arguments passed to mmap()John Baldwin2015-08-061-0/+72
| | | | | | | | | | trigger failures. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3269 Notes: svn path=/head/; revision=286370
* Convert the map_at_zero test case to ATF. In particular, this willJohn Baldwin2015-08-062-37/+24
| | | | | | | | | | facilitate adding more mmap() tests. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3268 Notes: svn path=/head/; revision=286369
* Clear P_TRACED before reparenting a detached process back to itsJohn Baldwin2015-08-011-54/+527
| | | | | | | | | | | | | | original parent. Otherwise the debugee will be set as an orphan of the debugger. Add tests for tracing forks via PT_FOLLOW_FORK. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2809 Notes: svn path=/head/; revision=286158
* Fixed shutdown(2) unix(4) tests for SOCK_SEQPACKET after r285910 (by ed).Sergey Kandaurov2015-07-291-8/+52
| | | | Notes: svn path=/head/; revision=286011
* Pass unsigned long argument to ioctl().Craig Rodrigues2015-07-261-1/+2
| | | | | | | | | Eliminates "ioctl sign-extension" warnings. PR: 200896 Notes: svn path=/head/; revision=285891
* The bug caught by flock's test 16 was fixed by r268384.Mark Johnston2015-07-051-5/+0
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=285184
* Make cleanup routines idempotentJulio Merino2015-07-041-7/+12
| | | | | | | | | | | | | | | | | cleanup routines can be executed at any point during the execution of the body, including even before the body has done any real work. In those cases, cleanup routines should be careful to not raise spurious errors so as to not "override" the actual result of the test case. This is just general good coding style but is not a problem in practice for these specific tests. (The way I discovered the issue, though, was due to a regression I introduced in Kyua itself while refactoring some internals.) MFC after: 1 week Notes: svn path=/head/; revision=285117
* Misc fixes from projects/bmakeSimon J. Gerraty2015-06-111-1/+1
| | | | | | | | Differential Revision: D2748 Reviewed by: brooks imp Notes: svn path=/head/; revision=284289
* Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processesJohn Baldwin2015-06-041-25/+47
| | | | | | | | | | of the main test process. Differential Revision: https://reviews.freebsd.org/D2664 Reviewed by: ngie (previous version) Notes: svn path=/head/; revision=284000
* Append to SUBDIR, not set itEnji Cooper2015-05-311-2/+2
| | | | | | | Pointyhat to: ngie Notes: svn path=/head/; revision=283845
* Consistently only use one end of the pipe in the parent and debuggerJohn Baldwin2015-05-311-3/+5
| | | | | | | | | | | processes and do not rely on EOF due to a close() in the debugger. PR: 200489 Differential Revision: https://reviews.freebsd.org/D2674 Reviewed by: kib, ngie, rodrigc Notes: svn path=/head/; revision=283836
* Tweak the description of when waitpid() doesn't return any status for aJohn Baldwin2015-05-281-6/+6
| | | | | | | | | non-blocking wait to avoid the word "empty". Requested by: ngie Notes: svn path=/head/; revision=283647
* Do not allow a process to reap an orphan (a child currently beingJohn Baldwin2015-05-261-0/+246
| | | | | | | | | | | | | | | | | | | | traced by another process such as a debugger). The parent process does need to check for matching orphan pids to avoid returning ECHILD if an orphan has exited, but it should not return the exited status for the child until after the debugger has detached from the orphan process either explicitly or implicitly via wait(). Add two tests for for this case: one where the debugger is the direct child (thus the parent has a non-empty children list) and one where the debugger is not a direct child (so the only "child" of the parent is the orphan). Differential Revision: https://reviews.freebsd.org/D2644 Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=283562
* Only reparent a traced process to its old parent if the tracing process isJohn Baldwin2015-05-222-0/+144
| | | | | | | | | | | | | | | not the old parent. Otherwise, proc_reap() will leave the zombie in place resulting in the process' status being returned twice to its parent. Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by this change. Differential Revision: https://reviews.freebsd.org/D2594 Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=283282
* Move all test integration pieces for etc/ from etc/ to tests/Enji Cooper2015-05-184-0/+158
| | | | | | | | | | | | | | This is being done to fix breakage with make distribution with read-only source trees as make distribution doesn't use make obj like building tests/ does in all cases Reported by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org> Suggested by: jhb X-MFC with: r282059 MFC after: 1 week Notes: svn path=/head/; revision=283056
* Fix typo. It should have been atf_tc_skip, not atf_skipEnji Cooper2015-04-291-1/+1
| | | | | | | | | Reported by: many, Jenkins Pointyhat to: ngie MFC after: 4 days Notes: svn path=/head/; revision=282244
* ATF_REQUIRE_KERNEL_MODULE: use atf_skip, not ATF_REQUIRE_MSG so the testcaseEnji Cooper2015-04-291-7/+10
| | | | | | | | | | | no longer bombs out PLAIN_REQUIRE_KERNEL_MODULE: use printf + _exit, no err so the testcase no longer bombs out if it prints to stderr MFC after: 5 days Notes: svn path=/head/; revision=282211
* Adjust CFLAGS to find freebsd_test_suite/macros.hEnji Cooper2015-04-281-0/+2
| | | | | | | MFC after: 6 days Notes: svn path=/head/; revision=282138
* Use PLAIN_REQUIRE_KERNEL_MODULE to require "mqueuefs"Enji Cooper2015-04-286-0/+22
| | | | | | | MFC after: 6 days Notes: svn path=/head/; revision=282137
* - Use ATF_REQUIRE_KERNEL_MDOULE to require aio(4)Enji Cooper2015-04-282-25/+33
| | | | | | | | | | | - Don't use /tmp as a basis for temporary files as it's outside of the ATF sandbox - Don't override MAX macro in sys/param.h MFC after: 6 days Notes: svn path=/head/; revision=282136
* Use ATF_REQUIRE_KERNEL_MODULE instead of aio_available functionEnji Cooper2015-04-281-17/+10
| | | | | | | MFC after: 6 days Notes: svn path=/head/; revision=282135
* Add initial (unpolished) macros for interfacing with the FreeBSD test suiteEnji Cooper2015-04-281-0/+53
| | | | | | | | | | This is very rough, but will be replaced/redesigned some time soon after I fix the Jenkins breakage I introduced MFC after: 6 days Notes: svn path=/head/; revision=282134
* Fill in the copyright boilerplate for the test programEnji Cooper2015-04-281-0/+27
| | | | | | | MFC after: 6 days Notes: svn path=/head/; revision=282133
* Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_testEnji Cooper2015-04-274-1/+8
| | | | | | | | | | | | As jhb noted, the actual mmap(2) implementation is under sys/vm, not sys/kern/, so the correct logical place is tests/sys/vm/, not tests/sys/kern/ X-MFC with: r282076 MFC after: 6 days Notes: svn path=/head/; revision=282104
* Integrate tools/regression/mmap into the FreeBSD test suite asEnji Cooper2015-04-272-0/+106
| | | | | | | | | tests/sys/kern/mmap_test MFC after: 1 week Notes: svn path=/head/; revision=282076
* Integrate tools/regression/aio/aiotest and tools/regression/aio/kqueue into theEnji Cooper2015-04-275-0/+1132
| | | | | | | | | FreeBSD test suite as tests/sys/aio MFC after: 1 week Notes: svn path=/head/; revision=282074
* Integrate tools/regression/mqueue into the FreeBSD test suite asEnji Cooper2015-04-278-0/+577
| | | | | | | | | tests/sys/mqueue MFC after: 1 week Notes: svn path=/head/; revision=282071
* Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifoEnji Cooper2015-04-2714-0/+5256
| | | | | | | | | and tools/regression/file into the FreeBSD test suite as tests/sys/file MFC after: 1 week Notes: svn path=/head/; revision=282067
* Integrate tools/regression/kqueue into the FreeBSD test suite asEnji Cooper2015-04-2712-0/+1770
| | | | | | | | | tests/sys/kqueue MFC after: 1 week Notes: svn path=/head/; revision=282063
* Integrate tools/regression/execve into the FreeBSD test suite asEnji Cooper2015-04-2711-0/+279
| | | | | | | | | tests/sys/kern/execve MFC after: 1 week Notes: svn path=/head/; revision=282061
* Add some new modes to OpenCrypto. These modes are AES-ICM (can be usedJohn-Mark Gurney2014-12-127-0/+1311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for counter mode), and AES-GCM. Both of these modes have been added to the aesni module. Included is a set of tests to validate that the software and aesni module calculate the correct values. These use the NIST KAT test vectors. To run the test, you will need to install a soon to be committed port, nist-kat that will install the vectors. Using a port is necessary as the test vectors are around 25MB. All the man pages were updated. I have added a new man page, crypto.7, which includes a description of how to use each mode. All the new modes and some other AES modes are present. It would be good for someone else to go through and document the other modes. A new ioctl was added to support AEAD modes which AES-GCM is one of them. Without this ioctl, it is not possible to test AEAD modes from userland. Add a timing safe bcmp for use to compare MACs. Previously we were using bcmp which could leak timing info and result in the ability to forge messages. Add a minor optimization to the aesni module so that single segment mbufs don't get copied and instead are updated in place. The aesni module needs to be updated to support blocked IO so segmented mbufs don't have to be copied. We require that the IV be specified for all calls for both GCM and ICM. This is to ensure proper use of these functions. Obtained from: p4: //depot/projects/opencrypto Relnotes: yes Sponsored by: FreeBSD Foundation Sponsored by: NetGate Notes: svn path=/head/; revision=275732
* Use PROGS instead of PROG and remove unnecessary SRCS?= assignmentEnji Cooper2014-11-081-3/+2
| | | | | | | | | | | | | | | | | | Using PROG instead of PROGS will in cases of high -j with -DNO_ROOT cause the PROG to show up more than once as it's handling the SCRIPTS install case in a recursive manner, separate from the non-recursive case After the recent batch of commits to bsd.progs.mk to fix behavior with how variables are defaulted to, explicitly setting SRCS for a PROG is no longer required MFC after: 1 week Reviewed by: asomers Phabric: D1130 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274267
* Remove unused tests/lib directoryEnji Cooper2014-11-031-13/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=274052
* Remove explicit KYUAFILE=yes from tests/sys/MakefileEnji Cooper2014-11-031-4/+0
| | | | | | | | | | | | | This causes the directory traversing Kyuafile to be installed, which in turn causes tests/sys/pjdfstest to always be run from /usr/tests/sys Let KYUAFILE default to auto, so the file generated by suite.test.mk gets installed instead MFC after: 1 week Notes: svn path=/head/; revision=274021
* Integrate pjdfstest test suite execution into kyuaEnji Cooper2014-11-0321-1/+379
| | | | | | | | | | | | | | | | | pjdfstest execution is opt-in and must be done as root due to some of the assumptions made by the test suite and lack of error checking in the non-root case A description of how to execute pjdfstest with kyua is provided in share/pjdfstest/README Phabric: D824 (an earlier prototype patch) MFC after: 1 month Relnotes: yes Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274016
* Fix source address selection on unbound sockets in the presence of multipleAlan Somers2014-09-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | fibs. Use the mbuf's or the socket's fib instead of RT_ALL_FIBS. Fixes PR 187553. Also fixes netperf's UDP_STREAM test on a nondefault fib. sys/netinet/ip_output.c In ip_output, lookup the source address using the mbuf's fib instead of RT_ALL_FIBS. sys/netinet/in_pcb.c in in_pcbladdr, lookup the source address using the socket's fib, because we don't seem to have the mbuf fib. They should be the same, though. tests/sys/net/fibs_test.sh Clear the expected failure on udp_dontroute. PR: 187553 CR: https://reviews.freebsd.org/D772 MFC after: 3 weeks Sponsored by: Spectra Logic Notes: svn path=/head/; revision=271675
* Abort the create_socket test if socket creation fails.Alan Somers2014-09-101-1/+1
| | | | | | | | | MFC after: 1 week Reported by: Coverity CID: 1232756 Notes: svn path=/head/; revision=271397
* Numerous small fixes, mostly suggested by Coverity.Alan Somers2014-08-201-6/+47
| | | | | | | | | | | | | | | | | | | | | | | | | tests/sys/kern/unix_seqpacket_test.c * Remove a duplicate error check in mk_pair_of_sockets * Always close sockets in the success path of ATF test cases. Don't bother with the error paths, because those are mostly assertions anyway. Most of these socket leaks were reported by Coverity. All of them are harmless, because each ATF test case runs in its own process. * Fix the len argument to send in shutdown_send and shutdown_send_sigpipe. The old version was using sizeof a pointer instead of sizeof the char array. Reported by Coverity. * Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably continue past a failure. Reported by: Coverity Scan CID: 1229995, 1229991, 1229988, 1229994, 1229989, 1229992 CID: 1229993, 1229990, 1229984, 1229967, 1230005, 1229977 CID: 1229966, 1230004, 1229976 MFC after: 1 week Sponsored by: Spectra Logic Notes: svn path=/head/; revision=270228
* Fix unintended KBI change from r264905. Add _fib versions ofAlan Somers2014-05-292-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior. sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum. sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c Improve the udp_dontroute test. The bug that this test exercises is that ifa_ifwithnet() will return the wrong address, if multiple interfaces have addresses on the same subnet but with different fibs. The previous version of the test only considered one possible failure mode: that ifa_ifwithnet_fib() might fail to find any suitable address at all. The new version also checks whether ifa_ifwithnet_fib() finds the correct address by checking where the ARP request goes. Reported by: bz, hrs Reviewed by: hrs MFC after: 1 week X-MFC-with: 264905 Sponsored by: Spectra Logic Notes: svn path=/head/; revision=266860
* Remove last two NO_MAN= in the tree. In both of these cases, MAN= isWarner Losh2014-05-101-1/+1
| | | | | | | what is needed. Notes: svn path=/head/; revision=265836
* Add regression test for PR kern/189088.Alan Somers2014-04-291-0/+54
| | | | | | | | | PR: kern/189088 MFC after: 3 weeks Sponsored by: Spectra Logic Notes: svn path=/head/; revision=265094
* Fix a panic when removing an IP address from an interface, if the same addressAlan Somers2014-04-291-0/+40
| | | | | | | | | | | | | | | | | | exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. PR: kern/189089 Reported by: neel Reviewed by: neel MFC after: 3 weeks X-MFC with: 264887 Sponsored by: Spectra Logic Notes: svn path=/head/; revision=265092
* Style fixes, mostly trailing whitespace elimination. No functional change.Alan Somers2014-04-252-14/+15
| | | | | | | | Reported by: pho MFC after: 3 weeks Notes: svn path=/head/; revision=264917
* Fix subnet and default routes on different FIBs on the same subnet.Alan Somers2014-04-243-38/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address. sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument. sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments. sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib. sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile Revert r263738. The udp_dontroute test was right all along. However, bugs kern/187550 and kern/187553 cancelled each other out when it came to this test. Because of kern/187553, ifa_ifwithnet searched the default fib instead of the requested one, but because of kern/187550, there was an applicable subnet route on the default fib. The new test added in r263738 doesn't work right, however. I can verify with dtrace that ifa_ifwithnet returned the wrong address before I applied this commit, but route(8) miraculously found the correct interface to use anyway. I don't know how. Clear expected failure messages for kern/187550 and kern/187552. PR: kern/187550 PR: kern/187552 Reviewed by: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Notes: svn path=/head/; revision=264905
* Fix host and network routes for new interfaces when net.add_addr_allfibs=0Alan Somers2014-04-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. PR: kern/187549 Reviewed by: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=264887
* Fix variable type to avoid printf formatter warning.Julio Merino2014-04-041-1/+1
| | | | | | | | This fixes the build under powerpc64 where gcc complains about a mismatch between a %zd printf formatter and an int variable passed to it. Notes: svn path=/head/; revision=264133