Page MenuHomeFreeBSD

Fix up concurrent test zpool setup and teardown
ClosedPublic

Authored by ngie on Jan 29 2019, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 2:23 PM
Unknown Object (File)
Mar 16 2024, 10:36 AM
Unknown Object (File)
Jan 25 2024, 6:42 AM
Unknown Object (File)
Jan 11 2024, 11:06 PM
Unknown Object (File)
Jan 6 2024, 10:50 PM
Unknown Object (File)
Dec 20 2023, 4:23 AM
Unknown Object (File)
Sep 25 2023, 7:45 PM
Unknown Object (File)
Sep 1 2023, 11:02 AM
Subscribers

Details

Summary

Set up zpools with a more unique name, stash the zpool name away in a file pointed
to by $ZPOOL_NAME_FILE (which is relative to a per-testcase generated temporary
directory), then remove the file based on $ZPOOL_NAME_FILE in the cleanup
routines.

This is a more concurrency-safe solution and will allow the testcases to be safely
executed in parallel.

MFC after: 1 week

Test Plan

kyua test passed

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add a sanity check to the deep setup routine as well and add a comment as to why test -n is being executed

ngie retitled this revision from Fix up test zpool setup and teardown to Fix up concurrent test zpool setup and teardown.Jan 29 2019, 10:44 PM
ngie edited the summary of this revision. (Show Details)
ngie edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 31 2019, 11:49 AM

Feel free to commit with "Approved by: jtl".

sbin/bectl/tests/bectl_test.sh
36 ↗(On Diff #53401)

Unless I'm mistaken, there's no guarantee of uniqueness here. Instead, it seems like this makes it highly likely that there will not be a name conflict, but doesn't completely eliminate it.

It might be worth qualifying the commit message slightly to indicate this.

ngie marked an inline comment as done.
ngie added inline comments.
sbin/bectl/tests/bectl_test.sh
36 ↗(On Diff #53401)

mktemp -u certainly isn't perfect, but it's considerably better than always providing a deterministic zpool name.

I added "more" to the commit message to note that this isn't perfect.

This revision was automatically updated to reflect the committed changes.
ngie marked an inline comment as done.