Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid error in cleanup if test if unsupported #16114

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

sethtroisi
Copy link
Contributor

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 with log_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 in user_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 change SKIP 1 before my change FAIL 1

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Seth Troisi <sethtroisi@google.com>
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 19, 2024
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 19, 2024
@behlendorf behlendorf merged commit cdae59e into openzfs:master Apr 22, 2024
25 checks passed
@sethtroisi sethtroisi deleted the tst_user_namespace_004 branch April 22, 2024 17:49
tonyhutter pushed a commit that referenced this pull request May 2, 2024
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Seth Troisi <sethtroisi@google.com>
Closes #16114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants