-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: Avoid test failure on Linux root without cap-add LINUX_IMMUTABLE #28545
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK fa40b3e
rfm or is anything left to be done here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fa40b3e
@@ -45,6 +46,11 @@ def reindex_readonly(self): | |||
self.log.warning(f"stdout: {e.stdout}") | |||
if e.stderr: | |||
self.log.warning(f"stderr: {e.stderr}") | |||
if os.getuid() == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you retouch, maybe
if os.getuid() == 0: | |
if os.getuid() == 0: # 0 implies user is root (Unix/Linux) |
self.log.warning("Return early on Linux under root, because chattr failed.") | ||
self.log.warning("This should only happen due to missing capabilities in a container.") | ||
self.log.warning("Make sure to --cap-add LINUX_IMMUTABLE if you want to run this test.") | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: what does the return
here add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return
means that the function terminates and returns its return value.
As explained in the pull request title, the return is required to avoid the test failure.
…ap-add LINUX_IMMUTABLE fa40b3e test: Avoid test failure on Linux root without cap-add LINUX_IMMUTABLE (MarcoFalke) Pull request description: This turns a test failure on Linux when running the test as `root`, but without the `LINUX_IMMUTABLE` capability, into an early return, with a suggestion to turn on `LINUX_IMMUTABLE` next time (if possible). ACKs for top commit: pinheadmz: utACK fa40b3e jonatack: ACK fa40b3e Tree-SHA512: d986ff8aeae5f8267c21a23d5be16f7c5a4d4d3be045a6999d8b39c7b8672cfe915dedde762cc9965cdc4970940bffc4b0d1412833d8036d4425450eb6181f67
This turns a test failure on Linux when running the test as
root
, but without theLINUX_IMMUTABLE
capability, into an early return, with a suggestion to turn onLINUX_IMMUTABLE
next time (if possible).