mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-23 06:31:58 +00:00
Merge pull request #5113 from finefoot/patch-2
Port of #5112 Fix tests of read-only repos for non-root users
This commit is contained in:
commit
b7acf0da74
1 changed files with 2 additions and 0 deletions
|
@ -290,11 +290,13 @@ def read_only(self, path):
|
|||
message = 'Testing read-only repos is not supported on platform %s' % sys.platform
|
||||
self.skipTest(message)
|
||||
try:
|
||||
os.system('chmod -R ugo-w "%s"' % path)
|
||||
os.system(cmd_immutable)
|
||||
yield
|
||||
finally:
|
||||
# Restore permissions to ensure clean-up doesn't fail
|
||||
os.system(cmd_mutable)
|
||||
os.system('chmod -R ugo+w "%s"' % path)
|
||||
|
||||
|
||||
class changedir:
|
||||
|
|
Loading…
Reference in a new issue