diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-27 16:50:16 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-27 16:47:44 +0200 |
commit | fa40b3ee22e78f58d7426dbc4343472ba40081e3 (patch) | |
tree | fe1c0bf46ba62c5348ab0416c83e2b400f1833f4 | |
parent | b000ed5ee54438efb72e190262faeb535489d35d (diff) |
test: Avoid test failure on Linux root without cap-add LINUX_IMMUTABLE
-rwxr-xr-x | test/functional/feature_reindex_readonly.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/feature_reindex_readonly.py b/test/functional/feature_reindex_readonly.py index 9f1bb30023..26531f472b 100755 --- a/test/functional/feature_reindex_readonly.py +++ b/test/functional/feature_reindex_readonly.py @@ -6,6 +6,7 @@ - Start a node, generate blocks, then restart with -reindex after setting blk files to read-only """ +import os import platform import stat import subprocess @@ -45,6 +46,11 @@ class BlockstoreReindexTest(BitcoinTestFramework): self.log.warning(f"stdout: {e.stdout}") if e.stderr: self.log.warning(f"stderr: {e.stderr}") + if os.getuid() == 0: + 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 self.log.debug("Attempt to restart and reindex the node with the unwritable block file") with self.nodes[0].assert_debug_log(expected_msgs=['FlushStateToDisk', 'failed to open file'], unexpected_msgs=[]): |