diff --git a/src/borg/testsuite/platform.py b/src/borg/testsuite/platform.py index 3dae11b98..4ba033e54 100644 --- a/src/borg/testsuite/platform.py +++ b/src/borg/testsuite/platform.py @@ -9,32 +9,6 @@ from . import unopened_tempfile from .locking import free_pid # NOQA -ACCESS_ACL = """ -user::rw- -user:root:rw-:0 -user:9999:r--:9999 -group::r-- -group:root:r--:0 -group:9999:r--:9999 -mask::rw- -other::r-- -""".strip().encode( - "ascii" -) - -DEFAULT_ACL = """ -user::rw- -user:root:r--:0 -user:8888:r--:8888 -group::r-- -group:root:r--:0 -group:8888:r--:8888 -mask::rw- -other::r-- -""".strip().encode( - "ascii" -) - def fakeroot_detected(): return "FAKEROOTKEY" in os.environ diff --git a/src/borg/testsuite/platform_linux.py b/src/borg/testsuite/platform_linux.py index a71020a55..e41f39187 100644 --- a/src/borg/testsuite/platform_linux.py +++ b/src/borg/testsuite/platform_linux.py @@ -2,19 +2,39 @@ import tempfile from ..platform import acl_get, acl_set -from .platform import ( - DEFAULT_ACL, - ACCESS_ACL, - skipif_not_linux, - skipif_fakeroot_detected, - skipif_acls_not_working, - skipif_no_ubel_user, -) +from .platform import skipif_not_linux, skipif_fakeroot_detected, skipif_acls_not_working, skipif_no_ubel_user # set module-level skips pytestmark = [skipif_not_linux, skipif_fakeroot_detected] +ACCESS_ACL = """\ +user::rw- +user:root:rw-:0 +user:9999:r--:9999 +group::r-- +group:root:r--:0 +group:9999:r--:9999 +mask::rw- +other::r--\ +""".encode( + "ascii" +) + +DEFAULT_ACL = """\ +user::rw- +user:root:r--:0 +user:8888:r--:8888 +group::r-- +group:root:r--:0 +group:8888:r--:8888 +mask::rw- +other::r--\ +""".encode( + "ascii" +) + + def get_acl(path, numeric_ids=False): item = {} acl_get(path, item, os.stat(path), numeric_ids=numeric_ids)