소스 검색

fix test_recreate_basic on cygwin

looks like that chmod should only get done IF we are root (and on linux?).

taking away write permissions on windows/cygwin (and when running as normal
user) makes create_regular_file fail when it tries to create dir2/file3.
Thomas Waldmann 2 년 전
부모
커밋
15c51ee3c6
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/borg/testsuite/archiver/__init__.py

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

@@ -235,10 +235,10 @@ class ArchiverTestCaseBase(BaseTestCase):
             os.mknod("input/bdev", 0o600 | stat.S_IFBLK, os.makedev(10, 20))
             # Char device
             os.mknod("input/cdev", 0o600 | stat.S_IFCHR, os.makedev(30, 40))
-            # File mode
-            os.chmod("input/dir2", 0o555)  # if we take away write perms, we need root to remove contents
             # File owner
             os.chown("input/file1", 100, 200)  # raises OSError invalid argument on cygwin
+            # File mode
+            os.chmod("input/dir2", 0o555)  # if we take away write perms, we need root to remove contents
             have_root = True  # we have (fake)root
         except PermissionError:
             have_root = False