aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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
* audit(4): Add tests for a few syscalls in the ad classAlan Somers2018-06-172-0/+217
| | | | | | | | | | | | | The ad audit class is for administrative commands. This commit adds test for settimeofday, adjtime, and getfh. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15861 Notes: svn path=/head/; revision=335285
* audit(4): add tests for extattr_get_file(2) and friendsAlan Somers2018-06-171-0/+351
| | | | | | | | | | | | | | This commit includes extattr_{get_file, get_fd, get_link, list_file, list_fd, list_link}. It does not include any syscalls that modify, set, or delete extended attributes, as those are in a different audit class. Submitted by: aniketpt MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15859 Notes: svn path=/head/; revision=335284
* audit(4): add tests for chflags and friendsAlan Somers2018-06-171-0/+142
| | | | | | | | | | | | chflags, fchflags, and lchflags (but not chflagsat) are included. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15854 Notes: svn path=/head/; revision=335275
* audit(4): add tests for pathconf(2) and friendsAlan Somers2018-06-161-0/+145
| | | | | | | | | | | | pathconf, lpathconf, and fpathconf are included Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15842 Notes: svn path=/head/; revision=335261
* audit(4): add tests for POSIX message queuesAlan Somers2018-06-162-0/+416
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15848 Notes: svn path=/head/; revision=335260
* audit(4): add tests for chown(2) and friendsAlan Somers2018-06-161-0/+190
| | | | | | | | | | | | Includes chown, fchown, lchown, and fchownat Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15825 Notes: svn path=/head/; revision=335256
* audit(4): add tests for bind(2), bindat(2), and listen(2)Alan Somers2018-06-161-7/+205
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15843 Notes: svn path=/head/; revision=335255
* audit(4): Add a few tests for network-related syscallsAlan Somers2018-06-152-0/+217
| | | | | | | | | | | | Add tests for socket(2), socketpair(2), and setsockopt(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15803 Notes: svn path=/head/; revision=335215
* audit(4): improve formatting in tests/sys/audit/open.cAlan Somers2018-06-151-86/+86
| | | | | | | | | | | | [skip ci] Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15797 Notes: svn path=/head/; revision=335208
* audit(4): add tests for access(2), chmod(2), and friendsAlan Somers2018-06-152-0/+331
| | | | | | | | | | | | | | access(2), eaccess(2), faccessat(2), chmod(2), fchmod(2), lchmod(2), and fchmodat(2). Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15805 Differential Revision: https://reviews.freebsd.org/D15808 Notes: svn path=/head/; revision=335207
* audit(4): add tests for fhopen, fhstat, and fhstatfsAlan Somers2018-06-141-1/+167
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15798 Notes: svn path=/head/; revision=335145
* audit(4): fix typo from r335136Alan Somers2018-06-141-1/+1
| | | | | | | | | | Typo in Makefile accidentally disabled some older tests MFC after: 2 weeks X-MFC-With: 335136 Notes: svn path=/head/; revision=335140
* audit(4): add tests for flock, fcntl, and fsyncAlan Somers2018-06-142-0/+202
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15795 Notes: svn path=/head/; revision=335136
* audit(4): add tests for statfs(2), fstatfs(2), and getfsstat(2)Alan Somers2018-06-141-0/+152
| | | | | | | | | | Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15750 Notes: svn path=/head/; revision=335105
* audit(4): Fix file descriptor leaks in ATF testsAlan Somers2018-06-137-30/+45
| | | | | | | | | | | | | | | | Submitted by: aniketp Reported by: Coverity CID: 1393343 1393346 1392695 1392781 1391709 1392078 1392413 CID: 1392014 1392521 1393344 1393345 1393347 1393348 1393349 CID: 1393354 1393355 1393356 1393357 1393358 1393360 1393362 CID: 1393368 1393369 1393370 1393371 1393372 1393373 1393376 CID: 1393380 1393384 1393387 1393388 1393389 MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15782 Notes: svn path=/head/; revision=335067
* audit(4): add tests for stat(2) and friendsAlan Somers2018-06-102-1/+243
| | | | | | | | | | | | | This revision adds auditability tests for stat, lstat, fstat, and fstatat, all from the fa audit class. More tests from that audit class will follow. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15709 Notes: svn path=/head/; revision=334933
* pf tests: Basic route-to testsKristof Provost2018-06-092-1/+83
| | | | | | | | Very basic route-to tests. These tests attempt to provoke PR 228782 for IPv4 and IPv6. A test failure will panic the machine. Notes: svn path=/head/; revision=334877
* audit(4): add tests for open(2) and openat(2)Alan Somers2018-06-052-0/+194
| | | | | | | | | | | | | | These syscalls are atypical, because each one corresponds to several different audit events, and they each pass several different audit class filters. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15657 Notes: svn path=/head/; revision=334668
* audit(4): add tests for the cl audit classAlan Somers2018-06-032-1/+240
| | | | | | | | | | | | The only syscalls in this class are close, closefrom, munmap, and revoke. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15650 Notes: svn path=/head/; revision=334592
* audit(4): add tests for the fd audit classAlan Somers2018-06-012-0/+274
| | | | | | | | | | | | | | The only syscalls in this class are rmdir, unlink, unlinkat, rename, and renameat. Also, set is_exclusive for all audit(4) tests, because they can start and stop auditd. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15647 Notes: svn path=/head/; revision=334496
* audit(4): Add tests for the fw class of syscalls.Alan Somers2018-06-012-0/+142
| | | | | | | | | | | | | | truncate and ftruncate are the only syscalls in this class, apart from certain variations of open and openat, which will be handled in a different file. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15640 Notes: svn path=/head/; revision=334487
* audit(4): Add tests for the fr class of syscallsAlan Somers2018-06-015-3/+139
| | | | | | | | | | | | | | readlink and readlinkat are the only syscalls in this class. open and openat are as well, but they'll be handled in a different file. Also, tidy up the copyright headers of recently added files in this area. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15636 Notes: svn path=/head/; revision=334471
* Revert r334362Alan Somers2018-05-301-0/+1
| | | | | | | | | | Reconnect tests/sys/audit now that the GCC issue is fixed by 334388 MFC after: 2 weeks X-MFC-With: 334362, 334360, 334388 Notes: svn path=/head/; revision=334395
* Temporarily disconnect audit testsEd Maste2018-05-301-1/+0
| | | | | | | | | Audit tests added in r334360 broke the build on a number of archs. Remove the subdir from the top level tests/sys/Makefile until they're fixed. Notes: svn path=/head/; revision=334362
* Add initial set of tests for audit(4)Alan Somers2018-05-295-0/+879
| | | | | | | | | | | | | | | | | This change includes the framework for testing the auditability of various syscalls, and includes changes for the first 12. The tests will start auditd(8) if needed, though they'll be much faster if it's already running. The syscalls tested in this commit include mkdir(2), mkdirat(2), mknod(2), mknodat(2), mkfifo(2), mkfifoat(2), link(2), linkat(2), symlink(2), symlinkat(2), rename(2), and renameat(2). Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15286 Notes: svn path=/head/; revision=334360
* Export a breakpoint() function to userland for riscv.John Baldwin2018-05-161-1/+3
| | | | | | | | | | As a result, enable tests using breakpoint() on riscv. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D15191 Notes: svn path=/head/; revision=333679
* Strip trailing / from TESTSDIREd Maste2018-05-115-5/+5
| | | | | | | | | | Otherwise makefs gets upset: makefs: ./usr/tests/sys/cddl/zfs/tests/exec/: empty leaf element Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333495
* Disable connectat/bindat with AT_FDCWD in capmodeEd Maste2018-04-302-0/+236
| | | | | | | | | | | | | | | | | | | | Previously it was possible to connect a socket (which had the CAP_CONNECT right) by calling "connectat(AT_FDCWD, ...)" even in capabilties mode. This combination should be treated the same as a call to connect (i.e. forbidden in capabilities mode). Similarly for bindat. Disable connectat/bindat with AT_FDCWD in capabilities mode, fix up the documentation and add tests. PR: 222632 Submitted by: Jan Kokemüller <jan.kokemueller@gmail.com> Reviewed by: Domagoj Stolfa MFC after: 1 week Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D15221 Notes: svn path=/head/; revision=333120
* Remove redundant pipe from pdeathsig.c test.Konstantin Belousov2018-04-271-7/+0
| | | | | | | | | | | | | | | | | | | | | A pipe was was left over from a development version of pdeathsig.c and is not needed. Process C waits for a signal that'll be generated when process B exists. Process B waits for process D to send it a byte via pipe_db before it exits. Process D sends the byte after it has started ptrace()ing process C. The point of the test is to show that process C receives the signal because process B exited, even though C has been reparented to process D. The pipe pipe_cd isn't doing anything useful (though in an earlier version of the patch it did). Clean that up by removing the useless pipe. Submitted by: Thomas Munro MFC after: 6 days Differential revision: https://reviews.freebsd.org/D15214 Notes: svn path=/head/; revision=333067
* Shorten some recently-added lines that are an extra indent over 80 columns.John Baldwin2018-04-241-4/+4
| | | | Notes: svn path=/head/; revision=332976
* Add two tests for TRAP_* signal codes for SIGTRAP.John Baldwin2018-04-241-0/+108
| | | | | | | | | | - ptrace__breakpoint_siginfo tests that a SIGTRAP for a software breakpoint in userland triggers a SIGTRAP with a signal code of TRAP_BRKPT. - ptrace__step_siginfo tests that a SIGTRAP reported for a step after stepping via PT_STEP or PT_SETSTEP has a signal code of TRAP_TRACE. Notes: svn path=/head/; revision=332908
* Expose breakpoint() to userland from <machine/cpufunc.h> on MIPS.John Baldwin2018-04-241-1/+4
| | | | | | | | | | Enable ptrace() tests using breakpoint on MIPS as well. Tested on: mips64 MFC after: 1 month Notes: svn path=/head/; revision=332907