]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix problems in the kern_maxfiles__increase test
authorEric van Gyzen <vangyzen@FreeBSD.org>
Tue, 8 Oct 2019 13:43:05 +0000 (13:43 +0000)
committerEric van Gyzen <vangyzen@FreeBSD.org>
Tue, 8 Oct 2019 13:43:05 +0000 (13:43 +0000)
commit4661f8af4005747282fa6b2e9c0e54d3e148a8f2
tree775ea96f098c58a1614d49e7263507556ef39573
parentac99b252987d48424afdefb396c9c501088411cc
Fix problems in the kern_maxfiles__increase test

ATF functions such as ATF_REQUIRE do not work correctly in child processes.
Use plain C functions to report errors instead.

In the parent, check for the untimely demise of children.  Without this,
the test hung until the framework's timeout.

Raise the resource limit on the number of open files.  If this was too low,
the test hit the two problems above.

Restore the kern.maxfiles sysctl OID in the cleanup function.
The body prematurely removed the symlink in which the old value was saved.

Make the test more robust by opening more files.  In fact, due to the
integer division by 4, this was necessary to make the test valid with
some initial values of maxfiles.  Thanks, asomers@.

wait() for children instead of sleeping.

Clean up a temporary file created by the test ("afile").

Reviewed by: asomers
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21900
tests/sys/kern/kern_descrip_test.c