Structure of ATF testcases (was "Test scenario for sysctl kern.maxfiles")

Julio Merino jmmv at
Thu Mar 13 02:10:17 UTC 2014

On Fri, Mar 7, 2014 at 5:02 AM, Garrett Cooper <yaneurabeya at> wrote:
> On Thu, Mar 6, 2014 at 11:54 AM, Julio Merino <jmmv at> wrote:
>> On Thu, Mar 6, 2014 at 1:28 PM, Garrett Cooper <yaneurabeya at> wrote:
>>> Seems like another standalone tool should be developed to cleanup
>>> variables after exit per test and per test suite.
>> Which variables?
> sysctls in this case. Isilon would probably love this and other folks
> would too no doubt.

Writing such support shouldn't be too hard.

I can imagine a sysctl(8) wrapper stored in the test's work directory,
put in the PATH, so that it captured all variables written to from the
test.  All this could be set up by a "sysctl-test setup" script or
similar. This script would record the old values in a separate file
within the work directory.  Later, in the cleanup phase, you'd invoke
a "sysctl-test cleanup" script that read the list of overridden
variables and restored their previous values.

We can easily do this as a FreeBSD-specific thingy for now and put it
in the source tree. I think it'd be a good way to test the idea this
way. We could generalize it into ATF later on, but adding hooks for
sysctl is nasty for portability reasons...

More information about the freebsd-testing mailing list