소스 검색

Fix tests of read-only repos for non-root users

finefoot 5 년 전
부모
커밋
842cfc8cdb
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/borg/testsuite/__init__.py

+ 2 - 0
src/borg/testsuite/__init__.py

@@ -290,11 +290,13 @@ class BaseTestCase(unittest.TestCase):
             message = 'Testing read-only repos is not supported on platform %s' % sys.platform
             message = 'Testing read-only repos is not supported on platform %s' % sys.platform
             self.skipTest(message)
             self.skipTest(message)
         try:
         try:
+            os.system('chmod -R ugo-w "%s"' % path)
             os.system(cmd_immutable)
             os.system(cmd_immutable)
             yield
             yield
         finally:
         finally:
             # Restore permissions to ensure clean-up doesn't fail
             # Restore permissions to ensure clean-up doesn't fail
             os.system(cmd_mutable)
             os.system(cmd_mutable)
+            os.system('chmod -R ugo+w "%s"' % path)
 
 
 
 
 class changedir:
 class changedir: