Commit Graph

94 Commits

Author SHA1 Message Date
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
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
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
ngie
e6fcc4a9f2 Append to SUBDIR, not set it
Pointyhat to: ngie
2015-05-31 22:24:29 +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
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
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
110cd2db75 Move all test integration pieces for etc/ from etc/ to tests/
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
2015-05-18 11:02:43 +00:00
ngie
0207f9a85e Fix typo. It should have been atf_tc_skip, not atf_skip
Reported by: many, Jenkins
Pointyhat to: ngie
MFC after: 4 days
2015-04-29 19:08:11 +00:00
ngie
699d6a9776 ATF_REQUIRE_KERNEL_MODULE: use atf_skip, not ATF_REQUIRE_MSG so the testcase
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
2015-04-29 08:56:56 +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
cad543ea75 Add initial (unpolished) macros for interfacing with the FreeBSD test suite
This is very rough, but will be replaced/redesigned some time soon after I fix
the Jenkins breakage I introduced

MFC after: 6 days
2015-04-28 10:50:31 +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
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
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
ngie
a98cd7cd0e Convert unix_passfd_test to ATF
Mark test 8 as an expected failure so it no longer counts as an unexpected one
2015-04-15 11:48:41 +00:00
ngie
ea6ad5f1a5 Pick a random port if a specific one isn't provided on the command line 2015-04-14 10:20:02 +00:00
ngie
198792ffb0 Test for EPROTOTYPE, not EPROTONOSUPPORT 2015-04-14 07:08:45 +00:00
ngie
b21c62fc96 Use socket, not sockets/ (XXX: reminder to add a sanity check for this later...) 2015-04-14 02:38:57 +00:00
ngie
aca5423834 Fix WARNS= 6 by removing garbage collecting unused argc/argv 2015-04-13 16:43:06 +00:00
ngie
1008de0400 Add mqueue_test.sh 2015-04-13 09:40:57 +00:00
ngie
f9d25abeaa Install the proper files 2015-04-13 09:40:25 +00:00
ngie
9fbf06ecf3 Add missing Makefiles for fifo and file 2015-04-13 04:48:13 +00:00
ngie
17d96ca20b Add $FreeBSD$ RCS tag 2015-04-12 12:31:19 +00:00
ngie
bf56b02931 Integrate tools/regression/execve into the FreeBSD test suite as tests/sys/kern/execve 2015-04-12 12:29:34 +00:00
ngie
86baa7f8f1 Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifo 2015-04-12 06:18:24 +00:00
ngie
63315aaf06 Integrate tools/regression/mmap into the FreeBSD test suite as tests/sys/mmap 2015-04-12 05:25:11 +00:00
ngie
3bb7bf6d5c Default to WARNS=6 2015-04-12 05:09:05 +00:00