Avoid error in cleanup if test if unsupported #16114
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
I built and tested zfs on a clean machine (not VM) with ubuntu 24.04 and got a failure in
user_namespace/user_namespace_004
, looking at the logs this test should be skipped on my machine but because the test setup (log_onexit
withlog_must zfs destroy
) the test FAILs.Description
Moved
log_onexit
below the check to see this test is supported.log_onexit almost always appears as the 1st or 2nd real line in the file. I could instead add a variable
SHOULD_CLEANUP=0
, set it true after the log_unsupported check, and conditionally perform the cleanup inuser_ns_cleanup
but that felt less clean IMHO.How Has This Been Tested?
Tested with
./scripts/zfs-tests.sh -v -t tests/zfs-tests/tests/functional/user_namespace/user_namespace_004
after my changeSKIP 1
before my changeFAIL 1
Types of changes
Checklist:
Signed-off-by
.