We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3bff0c3 + e5a5d67 commit 3aee110Copy full SHA for 3aee110
src/borg/testsuite/archiver/__init__.py
@@ -440,7 +440,12 @@ def read_only(path):
440
pytest.skip(message)
441
try:
442
os.system('LD_PRELOAD= chmod -R ugo-w "%s"' % path)
443
- os.system(cmd_immutable)
+ rc = os.system(cmd_immutable)
444
+ if rc != 0:
445
+ # If we cannot make the path immutable (e.g., missing CAP_LINUX_IMMUTABLE
446
+ # in containers or restricted environments), the read-only tests would
447
+ # not be meaningful. Skip them instead of failing.
448
+ pytest.skip(f"Unable to make path immutable with: {cmd_immutable} (rc={rc})")
449
yield
450
finally:
451
# Restore permissions to ensure clean-up doesn't fail
0 commit comments