From 2195558eea8addffe866af6be3c46e901de74d9a Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 20 Sep 2023 22:45:57 +0200 Subject: [PATCH] fix post-test permission issues --- src/borg/testsuite/archiver/create_cmd.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/borg/testsuite/archiver/create_cmd.py b/src/borg/testsuite/archiver/create_cmd.py index 30cf998d4..48d8fb236 100644 --- a/src/borg/testsuite/archiver/create_cmd.py +++ b/src/borg/testsuite/archiver/create_cmd.py @@ -173,9 +173,12 @@ def test_create_unreadable_parent(archiver): os.mkdir(parent_dir) os.mkdir(root_dir) os.chmod(parent_dir, 0o111) # --x--x--x == parent dir traversable, but not readable - cmd(archiver, "rcreate", "--encryption=none") - # issue #7746: we *can* read root_dir and we *can* traverse parent_dir, so this should work: - cmd(archiver, "create", "test", root_dir) + try: + cmd(archiver, "rcreate", "--encryption=none") + # issue #7746: we *can* read root_dir and we *can* traverse parent_dir, so this should work: + cmd(archiver, "create", "test", root_dir) + finally: + os.chmod(parent_dir, 0o771) # otherwise cleanup after this test fails @pytest.mark.skipif(is_win32, reason="unix sockets not available on windows")