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).
test: Avoid test failure on Linux root without cap-add LINUX_IMMUTABLE #28545
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2309-test-fix-root-cap- changing 1 files +6 −0-
maflcko commented at 2:49 PM on September 27, 2023: member
-
test: Avoid test failure on Linux root without cap-add LINUX_IMMUTABLE fa40b3ee22
-
DrahtBot commented at 2:49 PM on September 27, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See 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.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #28116 (test: update tool_wallet coverage for unexpected writes to wallet by jonatack)
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.
- DrahtBot added the label Tests on Sep 27, 2023
- pinheadmz approved
-
pinheadmz commented at 2:53 PM on September 27, 2023: member
utACK fa40b3ee22e78f58d7426dbc4343472ba40081e3
- maflcko added this to the milestone 26.0 on Sep 28, 2023
-
maflcko commented at 11:00 AM on September 29, 2023: member
rfm or is anything left to be done here?
-
in test/functional/feature_reindex_readonly.py:49 in fa40b3ee22
45 | @@ -45,6 +46,11 @@ def reindex_readonly(self): 46 | self.log.warning(f"stdout: {e.stdout}") 47 | if e.stderr: 48 | self.log.warning(f"stderr: {e.stderr}") 49 | + if os.getuid() == 0:
jonatack commented at 4:31 PM on September 30, 2023:if you retouch, maybe
if os.getuid() == 0: # 0 implies user is root (Unix/Linux)jonatack commented at 4:37 PM on September 30, 2023: memberACK fa40b3ee22e78f58d7426dbc4343472ba40081e3
in test/functional/feature_reindex_readonly.py:53 in fa40b3ee22
45 | @@ -45,6 +46,11 @@ def reindex_readonly(self): 46 | self.log.warning(f"stdout: {e.stdout}") 47 | if e.stderr: 48 | self.log.warning(f"stderr: {e.stderr}") 49 | + if os.getuid() == 0: 50 | + self.log.warning("Return early on Linux under root, because chattr failed.") 51 | + self.log.warning("This should only happen due to missing capabilities in a container.") 52 | + self.log.warning("Make sure to --cap-add LINUX_IMMUTABLE if you want to run this test.") 53 | + return
jonatack commented at 4:53 PM on September 30, 2023:Question: what does the
returnhere add?
maflcko commented at 7:44 AM on October 2, 2023:returnmeans 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.
fanquake merged this on Oct 2, 2023fanquake closed this on Oct 2, 2023maflcko deleted the branch on Oct 5, 2023Frank-GER referenced this in commit 269e965194 on Oct 5, 2023bitcoin locked this on Oct 4, 2024
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC
More mirrored repositories can be found on mirror.b10c.me