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
F142979473: D51501.id159167.diff
Sun, Jan 25, 1:44 AM
F142976001: D51501.id159019.diff
Sun, Jan 25, 1:19 AM
Unknown Object (File)
Mon, Jan 19, 7:28 PM
Unknown Object (File)
Mon, Jan 12, 6:29 PM
Unknown Object (File)
Sat, Jan 10, 7:26 AM
Unknown Object (File)
Mon, Dec 29, 12:55 PM
Unknown Object (File)
Dec 3 2025, 10:43 PM
Unknown Object (File)
Nov 2 2025, 12:17 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