freebsd-dev/contrib/netbsd-tests
Eric van Gyzen 20917cac7b sysv test: properly wait for children
In the msg and shm tests, if the child exited before the parent
entered sigsuspend(), the test would hang and time out.  This was
also a problem in the sem test, but the misuse of atf_tc_pass()
masked it.  Adding a short sleep before the sigsuspend() calls made
the hang 100% reliable.  With the same sleep in the new version,
the test passes reliably.

Remove calls to atf_tc_pass().  The call in the sem test broke the test
by exiting prematurely, after only one child out of five had finished.
The other two were harmless but unhelpful.

Reduce a one-second sleep to a more reasonable duration so I can quickly
run many iterations of the test.

Where feasible, assert that wait() returns the child PID.  While I'm here,
use the more succinct ATF_REQUIRE* instead of if/atf_tc_fail/else.

Flush stdout before forking to avoid double-flush.

Use errx() when errno is irrelevant.

Don't use ATF_REQUIRE* in children.  Apparently, the output doesn't
get saved.  The exit status works, so it fails correctly, but silently.

Re-enable the test in CI.

PR:		233649
Reviewed by:	markj (previous version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35187
2022-05-13 11:38:26 -05:00
..
bin Add testcases for cat -b 2017-06-06 21:50:00 +00:00
crypto Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00
dev Merge in changes from ^/vendor/NetBSD/tests/dist@r313245 2017-02-04 18:20:07 +00:00
fs tmpfs tests: check for built-in tmpfs module 2020-10-02 00:52:31 +00:00
games Restore pathing for factor(1), which unnecessarily diverged in r278616 2016-12-03 03:13:32 +00:00
include Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
ipf Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
kernel sysv test: properly wait for children 2022-05-13 11:38:26 -05:00
lib netbsd-tests: Fix the libc stat_socket test 2022-01-14 15:01:41 -05:00
libexec/ld.elf_so Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
modules Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
net Merge in changes from ^/vendor/NetBSD/tests/dist@r313245 2017-02-04 18:20:07 +00:00
rump Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
sbin newfs_msdos: connect the ATF test from NetBSD 2022-02-16 09:56:16 -06:00
share Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
sys Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
usr.bin sort: Make NetBSD sort tests compatible with our sort 2021-05-13 09:33:47 -04:00
usr.sbin mtree: Fix -f -f not considering type changes. 2019-09-12 18:44:48 +00:00
FREEBSD-upgrade
h_macros.h Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00