Browse Source

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 years ago
parent
commit
15c51ee3c6
1 changed files with 2 additions and 2 deletions
  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