Commit Graph

202 Commits

Author SHA1 Message Date
ngie
938fedc5e2 Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:36:57 +00:00
ngie
d248315c93 - Remove unused but set ssize in shutdown_send_sigpipe
- Add #ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS` for untestable code
  because FreeBSD doesn't have a means to map source addresses for
  SEQ_PACKET AF_UNIX sockets (paraphrased). Put pathname variable
  under the #ifdef to mute another unused but set variable warning

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:34:59 +00:00
ngie
44e964f2d2 Clean trailing whitespace
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:28:12 +00:00
ngie
c1954809f8 - Fix an improperly sized buffer for pathname [1]
- Fix a -Wunused-but-set-variable warning [2]

MFC after: 1 week
Reported by: cppcheck [1], gcc 4.9 [2]
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:21:36 +00:00
ngie
5fb486358b Fix style(9) a bit and ensure that error from initializing kqueue(2) is
sane

- Push the kqueue(2) initialization down so the errno will correspond with
  the failure instead of potentially being stomped on by functions called
  by `PLAIN_REQUIRE_KERNEL_MODULE`
- Delete trailing whitespace
- Add spaces between braces for conditional and control blocks (for/if)
- Use err/errx instead of perror+printf+exit/printf+exit.
- Remove braces for single-line conditionals

Tested with and without -DDEBUG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:18:22 +00:00
ngie
07728c8cff Place cancel and error under #ifdef DEBUG to mute
-Wunused-but-set-variable warnings reported by gcc 4.9

Remove some trailing whitespace as well

Tested with and without -DDEBUG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-28 02:01:41 +00:00
ngie
cde5c65b52 Delete the comment about running test_libugidfw_strings before testing
`mac_is_present` so it doesn't accidentally confuse people

MFC after: 3 days
X-MFC with: r292650
Sponsored by: EMC / Isilon Storage Division
2015-12-23 10:02:51 +00:00
ngie
e089052101 Move mac_bsdextended check up before running the test_libugidfw_strings testcases
I realize that these tests could be run before mac_bsdextended is loaded, but
it would overcomplicate things to special case handle the testcases before doing
the mac_bsdextended(4) feature check

The testcases will be split up so they can be run separately in the near future

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-12-23 09:59:31 +00:00
ngie
729dbfbab0 Dump out the output from flock_helper on failure so failures with the
test app can be debugged

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division
2015-12-22 02:10:31 +00:00
ngie
7bac4be87a Integrate tools/regression/mac/mac_bsdextended and
tools/regression/mac/mac_portacl into the FreeBSD test suite as
tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively

MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2015-12-21 21:24:03 +00:00
ngie
51e48e07fd MFhead@r291879 2015-12-06 00:42:11 +00:00
bdrewery
bb97a3d43c Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
ngie
99f16dfe7c Disable mqueue test # 3 and # 4 until __mq_oshandle is properly publicized
This will unbreak the test script and make things green again after r291440

Sponsored by: EMC / Isilon Storage Division
2015-12-01 07:52:41 +00:00
deischen
34ffbcc7e5 Disable a couple of tests, perhaps temporarily, since they use private
symbols that are not exported from librt.
2015-11-29 06:16:25 +00:00
ngie
0bb31e6737 MFhead @ r291345 2015-11-26 01:05:54 +00:00
bdrewery
5f79bbb12d Avoid requiring 'make depend' here.
Really this should not be a DPSRCS.  The acct_test.c should not #include
convert.c, but just link it in as a normal SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 20:38:20 +00:00
ngie
e98a8a4a44 MFhead @ r291235 2015-11-24 05:12:40 +00:00
ngie
6004b040a4 Integrate contrib/netbsd-tests/kernel/t_mqueue into the FreeBSD test
suite as tests/sys/kern/mqueue_test

MFC after: 1 week
2015-11-23 09:17:25 +00:00
ngie
0563099bff Fix up convert.c generation
- Use a temporary file for convert.c to reduce likelihood of an interrupted
  build resulting in bad code being written to convert.c
- Truncate the file instead of appending to it to ensure that the file being
  touched will not result in duplicate declarations/definitions from
  kern_acct.c if/when kern_acct.c changes.

MFC after: 1 week
2015-11-23 09:15:20 +00:00
ngie
24fc72b2c6 MFhead @ r290915 2015-11-16 06:02:09 +00:00
ngie
ac4414a9cd Integrate tools/regression/pipe in to the FreeBSD test suite as
tests/sys/kern/pipe

- Fix style(9) bugs
- Fix compiler warnings
- Use `nitems(x)` instead of `sizeof(x) / sizeof(*x)` pattern

The testcases will be converted over to ATF eventually, but for now will be
integrated in as plain C tests

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-16 05:38:40 +00:00
ngie
c7ad5e15a5 Integrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as
tests/sys/kern/lockf_test

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-16 04:56:14 +00:00
ngie
8857f1af71 Integrate acct(2) testcase in as tests/sys/kern/acct/acct_test
The :encode_tv_random_million testcase fails the epsilon tests a few thousand
times out of one million, so expect the testcase to fail

MFC after: 1 week
Submitted by: keramida
Sponsored by: EMC / Isilon Storage Division
2015-11-16 03:32:12 +00:00
ngie
258f6cac78 Integrate kern/kern_acct.c testcase in as tests/sys/kern/acct/acct_test
The :encode_tv_random_million testcase fails the epsilon tests few thousand
times out of one million, so expect the testcase to fail

MFC after: 1 week
Submitted by: keramida
Sponsored by: EMC / Isilon Storage Division
2015-11-16 03:28:28 +00:00
ngie
c1c4a02310 Enable pjdfstest in the FreeBSD test suite by default to get some
coverage on the root file system

Sponsored by: EMC / Isilon Storage Division
2015-11-16 02:27:38 +00:00
kib
0d79310cdf Add tests for the copyin(9) handling of illegal buffers.
Reviewed by:	emaste, ngie
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D3925
2015-10-19 20:22:17 +00:00
ngie
42a00c3dbd Integrate tools/regression/acltools into the FreeBSD test suite as tests/sys/acl
- Make the requirements more complete for the testcases
- Detect prerequisites so the tests won't fail (zfs.ko is loaded, zpool(1)
  is available, ACL support is enabled with UFS, etc).
- Work with temporary files/directories/mountpoints that work with atf/kyua
- Limit the testcases to work on temporary filesystems to reduce tainting the
  test host

MFC after: 2 weeks
Reviewed by: trasz (earlier version)
Differential Revision: https://reviews.freebsd.org/D3810
2015-10-17 08:39:37 +00:00
ngie
7a8ea850c6 Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD
test suite as tests/sys/posixshm

Some other highlights:
- Convert the testcases over to ATF
- Don't use hardcoded paths to /tmp (which violate the ATF/kyua samdbox); use
  mkstemp to generate temporary paths for non-SHM_ANON shm objects.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-17 04:32:21 +00:00
ngie
514260b6e7 Unify posixshm.c and shm_test.c
Convert both testcases over to ATF

Don't use hardcoded paths to /tmp; use mkstemp to generate
temporary paths for non-SHM_ANON created shm objects.
2015-10-17 03:13:22 +00:00
bdrewery
153205e33f Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 22:55:08 +00:00
ngie
4640526e7e Add Makefile missed in r289236 2015-10-14 18:29:53 +00:00
ngie
f516f6c2bc Redirect all stdout from run to stderr so failures can be debugged 2015-10-14 18:29:00 +00:00
ngie
ef127649af Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-10-14 08:16:15 +00:00
ngie
a628dafc86 Integrate tools/regression/acltools into tests/sys/acl
Apply patches I've been running for months on my GitHub project
2015-10-13 17:28:11 +00:00
ngie
5d430003c8 Add Makefile forgotten in r289224 2015-10-13 17:18:26 +00:00
ngie
d3814e98fd Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs 2015-10-13 16:51:12 +00:00
ngie
2c46ba7a42 Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD
test suite as tests/sys/posixshm
2015-10-13 16:50:12 +00:00
ngie
dd1f618367 Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
jhb
4437aff4a8 Tweak: use 'mainlwp' instead of 'mainpid' since this is a thread (LWP)
identifier, not a pid.
2015-10-06 22:59:00 +00:00
bdrewery
52adc6c504 Fix build with older GCC which, doesn't like 'main' being a variable name. 2015-10-06 22:54:04 +00:00
jhb
b86a33b09a Fix various edge cases related to system call tracing.
- Always set td_dbg_sc_* when P_TRACED is set on system call entry
  even if the debugger is not tracing system call entries.  This
  ensures the fields are valid when reporting other stops that
  occur at system call boundaries such as for PT_FOLLOW_FORKS or
  when only tracing system call exits.
- Set TDB_SCX when reporting the stop for a new child process in
  fork_return().  This causes the event to be reported as a system
  call exit.
- Report a system call exit event in fork_return() for new threads in
  a traced process.
- Copy td_dbg_sc_* to new threads instead of zeroing.  This ensures
  that td_dbg_sc_code in particular will report the system call that
  created the new thread or process when it reports a system call
  exit event in fork_return().
- Add new ptrace tests to verify that new child processes and threads
  report system call exit events with a valid pl_syscall_code via
  PT_LWPINFO.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D3822
2015-10-06 19:29:05 +00:00
ngie
e1dd16d965 Revert r288682
I meant to do this on ^/user/ngie/more-tests

Pointyhat to: ngie (use svn info next time...)
2015-10-05 03:26:51 +00:00
ngie
115d008392 Remove some paths preparing for a re-copy from head 2015-10-05 03:25:30 +00:00
ngie
7f1b3a0b68 Integrate tools/regression/acltools into tests/sys/acl
Apply patches I've been running for months on my GitHub project
2015-10-05 00:55:16 +00:00
ngie
51803bd765 Fix compilation with -Werror + -Wsigned enabled 2015-10-05 00:51:41 +00:00
ngie
8b6993c446 MFhead @ r288313 2015-09-27 23:33:54 +00:00
jhb
7c47a4f9ce Use _exit() instead of exit() in child processes created during tests.
Suggested by:	kib
2015-09-09 22:54:07 +00:00
jhb
87404d121b Add a test to verify that a traced process sees its original parent via
getppid() after a debugger process that is not the parent has attached.

Reviewed by:	kib (earlier version)
Differential Revision:	https://reviews.freebsd.org/D3615
2015-09-09 22:42:26 +00:00
jhb
fb3987c215 Properly size the children[] arrays in the follow fork tests. 2015-09-09 21:18:10 +00:00
jhb
3b2b2a3028 Add more mmap tests related to character devices.
- 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
2015-09-04 01:02:21 +00:00
ngie
87dee47409 MFhead @ r286584 2015-08-10 18:27:54 +00:00
jhb
6dd6018a93 Add various tests to ensure that invalid arguments passed to mmap()
trigger failures.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D3269
2015-08-06 16:14:29 +00:00
jhb
34fe2df04e Convert the map_at_zero test case to ATF. In particular, this will
facilitate adding more mmap() tests.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3268
2015-08-06 16:12:12 +00:00
jhb
13db4664b3 Clear P_TRACED before reparenting a detached process back to its
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
2015-08-01 16:27:52 +00:00
pluknet
bb208e16c0 Fixed shutdown(2) unix(4) tests for SOCK_SEQPACKET after r285910 (by ed). 2015-07-29 13:49:34 +00:00
ngie
2907322f74 MFhead @ r285904 2015-07-27 04:11:41 +00:00
rodrigc
d16fdde7e1 Pass unsigned long argument to ioctl().
Eliminates "ioctl sign-extension" warnings.

PR:		200896
2015-07-26 14:46:42 +00:00
markj
1478ec09c6 The bug caught by flock's test 16 was fixed by r268384.
MFC after:	3 days
2015-07-05 22:49:26 +00:00
jmmv
5c6b494ea7 Make cleanup routines idempotent
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
2015-07-04 02:22:26 +00:00
ngie
862ab3b5df Fix some -Wunused warnings 2015-06-14 11:08:27 +00:00
ngie
ffa05a49da Fix Makefile 2015-06-14 02:21:19 +00:00
ngie
7e38af37a8 MF head @ r284358 2015-06-13 22:40:40 +00:00
sjg
750b155101 Misc fixes from projects/bmake
Differential Revision:       D2748
Reviewed by: brooks imp
2015-06-11 21:13:05 +00:00
jhb
5f12aa248a Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes
of the main test process.

Differential Revision:	https://reviews.freebsd.org/D2664
Reviewed by:	ngie (previous version)
2015-06-04 21:07:27 +00:00
jhb
d0beba7962 Consistently only use one end of the pipe in the parent and debugger
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
2015-05-31 19:43:35 +00:00
ngie
0125984291 Readd fresh copies of the directories from head using svn copy 2015-05-31 02:15:22 +00:00
ngie
9eaf1cb6f6 Nuke some broken directories 2015-05-31 02:14:10 +00:00
ngie
a31ce0ad92 MF head @ r283796 2015-05-31 01:02:05 +00:00
jhb
7fad77ce36 Tweak the description of when waitpid() doesn't return any status for a
non-blocking wait to avoid the word "empty".

Requested by:	ngie
2015-05-28 13:56:19 +00:00
jhb
588ce3236a Do not allow a process to reap an orphan (a child currently being
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
2015-05-26 10:29:37 +00:00
ngie
1a0cbcd01a MFhead @ r283351 2015-05-24 07:11:03 +00:00
jhb
5ad66fe3b2 Only reparent a traced process to its old parent if the tracing process is
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
2015-05-22 11:04:54 +00:00
ngie
f26a36793e Adjust CFLAGS to find freebsd_test_suite/macros.h
MFC after: 6 days
2015-04-28 10:59:06 +00:00
ngie
7c41d36452 Use PLAIN_REQUIRE_KERNEL_MODULE to require "mqueuefs"
MFC after: 6 days
2015-04-28 10:56:59 +00:00
ngie
934db4e340 - Use ATF_REQUIRE_KERNEL_MDOULE to require aio(4)
- 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
2015-04-28 10:53:06 +00:00
ngie
7dc04ed65c Use ATF_REQUIRE_KERNEL_MODULE instead of aio_available function
MFC after: 6 days
2015-04-28 10:51:12 +00:00
ngie
e16b0a44bf Fill in the copyright boilerplate for the test program
MFC after: 6 days
2015-04-28 10:29:42 +00:00
ngie
eed7f1bcd9 Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_test
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
2015-04-27 17:53:09 +00:00
ngie
b0e50d6cad Try and fix filenames to diff reduce with head 2015-04-27 09:15:36 +00:00
ngie
4c90b6a467 Remove tests/sys/mmap
I changed my mind and integrated it into tests/sys/kern instead of
tests/sys/mmap, because the former location made more sense, and there was
only 1 test program to account for in the latter (and original) location
2015-04-27 09:13:11 +00:00
ngie
145b38d69a MFhead @ r282076 2015-04-27 09:10:32 +00:00
ngie
ccd7494b55 Integrate tools/regression/mmap into the FreeBSD test suite as
tests/sys/kern/mmap_test

MFC after: 1 week
2015-04-27 09:06:27 +00:00
ngie
89f63ebe20 Integrate tools/regression/aio/aiotest and tools/regression/aio/kqueue into the
FreeBSD test suite as tests/sys/aio

MFC after: 1 week
2015-04-27 08:51:40 +00:00
ngie
d89b0bcd8d Integrate tools/regression/mqueue into the FreeBSD test suite as
tests/sys/mqueue

MFC after: 1 week
2015-04-27 08:31:43 +00:00
ngie
64404803e0 Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifo
and tools/regression/file into the FreeBSD test suite as tests/sys/file

MFC after: 1 week
2015-04-27 08:15:17 +00:00
ngie
ba163e588e Integrate tools/regression/kqueue into the FreeBSD test suite as
tests/sys/kqueue

MFC after: 1 week
2015-04-27 07:37:48 +00:00
ngie
add5897136 Integrate tools/regression/execve into the FreeBSD test suite as
tests/sys/kern/execve

MFC after: 1 week
2015-04-27 07:22:18 +00:00
ngie
e82a52615a Add missing newline for SKIP plan 2015-04-25 05:25:41 +00:00
ngie
43e6794179 MFhead @ r281924 2015-04-24 10:18:41 +00:00
ngie
aba0162dff sparc64 gcc has -Wcast-align issues as well on sparc64; disable the warning for all compilers 2015-04-16 21:49:15 +00:00
ngie
9a97d02d52 Fix a warning related to type sizes found by testing on a 32-bit OS ;) (powerpc) 2015-04-16 09:41:37 +00:00
ngie
98df758776 Integrate tests/sys/aio/kqueue into tests/sys/aio 2015-04-16 08:46:43 +00:00
ngie
4e440231f7 Integrate tools/regression/aio/aiotest into the FreeBSD test suite as tests/sys/aio 2015-04-16 07:49:39 +00:00
ngie
ad9d440819 Update comments
Don't install/test unix_cmsg because it's broken [1]

PR: 199478
2015-04-16 06:06:45 +00:00
ngie
de089aea2a Set WARNS to 6, but turn off -Wcast-align; this is an issue with unix_cmsg and
unix_passfd_test
2015-04-16 05:38:19 +00:00
ngie
010f8b4f07 Fix WARNS=6 issues with gcc 2015-04-16 05:37:19 +00:00
ngie
4f3aa5e79f Don't use /tmp for temporary files; this violates ATF/kyuas sandbox 2015-04-16 00:44:59 +00:00
ngie
6777749baf Rename unix_sendtorace_test to unix_sendto_race_test 2015-04-16 00:39:20 +00:00
ngie
f5c00e0dfa Convert accf_data_attach_test over to ATF and mark all steps after step 8 in
the sourcecode broken (it fails on my system at least; more investigation
needed)
2015-04-16 00:37:11 +00:00
ngie
637cb129fc - Convert zerosend_test to an ATF format testcase
- bind to random ports
- Close the server port so the TCP testcases won't terminate prematurely
  because bind(2) failed
2015-04-15 14:20:03 +00:00