Page MenuHomeFreeBSD

jail: tests: cleanup the commands test a bit
ClosedPublic

Authored by kevans on Jul 24 2025, 6:38 PM.
Tags
None
Referenced Files
F131766829: D51501.id159019.diff
Sat, Oct 11, 12:16 AM
F131766824: D51501.id.diff
Sat, Oct 11, 12:16 AM
F131766823: D51501.id159167.diff
Sat, Oct 11, 12:16 AM
Unknown Object (File)
Fri, Oct 10, 5:46 PM
Unknown Object (File)
Wed, Oct 8, 8:46 PM
Unknown Object (File)
Fri, Oct 3, 4:27 PM
Unknown Object (File)
Thu, Oct 2, 4:57 AM
Unknown Object (File)
Thu, Oct 2, 2:23 AM
Subscribers

Details

Summary

We shouldn't be doing setup in a head() function, as this can cause
various problems. For instance, in this case, it caused test listing
to fail in some cases if we didn't get to execute the cleanup properly
by complaining to stderr if the directory could not be created.

Switch to using atf_check for sanity checking stdout; most of these
expressions are self-explanatory and will make it clear what the problem
is.

commands.jail.conf contains a hard-coded path that we can avoid, which
is probably good to avoid weird conflicts if other tests try to copy it
and do the same. Just make a copy of our jail.conf and add the test's
$PWD to it to get a generally unique jail root.

Finally, simplify the cleanup handler a bit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable