From 1e341c69b06af19255e413e5d5cd69643f292ea5 Mon Sep 17 00:00:00 2001 From: Zen Dodd Date: Fri, 9 Oct 2026 16:24:58 +1000 Subject: [PATCH] testsuite: classify platform requirements --- testsuite/profiles/cygwin.json | 2 ++ testsuite/profiles/macos.json | 1 + testsuite/tests/chroot-basis-forge-inner-module_test.py | 2 +- testsuite/tests/daemon-chroot-acl_test.py | 8 +++++--- testsuite/tests/daemon-symlink-escape-matrix_test.py | 6 ++++-- testsuite/tests/daemon-zstd-thread-exhaustion_test.py | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/testsuite/profiles/cygwin.json b/testsuite/profiles/cygwin.json index 431f584f..34a0c7fc 100644 --- a/testsuite/profiles/cygwin.json +++ b/testsuite/profiles/cygwin.json @@ -12,6 +12,7 @@ "interpose": "no native interposition", "linux_acl": "no Linux ACL semantics", "linux_interpose": "no Linux interposition", + "linux_nss_chroot": "no Linux NSS chroot", "linux_xattr": "no Linux xattr semantics", "native_build": "no reliable patched build", "noatime": "no O_NOATIME", @@ -23,6 +24,7 @@ "search_only": "no Linux search-only fixture", "simd": "no SIMD test build", "symlink_mode": "no symlink chmod", + "thread_count": "no process thread count", "unix_listener": "no named Unix listener passing", "unix_socketpair": "no Unix socketpair", "user_namespace": "no user namespaces" diff --git a/testsuite/profiles/macos.json b/testsuite/profiles/macos.json index b6a3ae90..8be4a180 100644 --- a/testsuite/profiles/macos.json +++ b/testsuite/profiles/macos.json @@ -6,6 +6,7 @@ "group_auth": "no Linux group-auth fixture", "linux_acl": "no Linux ACL semantics", "linux_interpose": "no Linux interposition", + "linux_nss_chroot": "no Linux NSS chroot", "linux_xattr": "no Linux xattr semantics", "noatime": "no O_NOATIME", "preallocate": "no preallocation support", diff --git a/testsuite/tests/chroot-basis-forge-inner-module_test.py b/testsuite/tests/chroot-basis-forge-inner-module_test.py index 7cad4885..ef2cacb3 100644 --- a/testsuite/tests/chroot-basis-forge-inner-module_test.py +++ b/testsuite/tests/chroot-basis-forge-inner-module_test.py @@ -36,7 +36,7 @@ import rsync_proto as rp PORT = 12973 require_tcp("the pure-Python sender needs a real TCP daemon; run with --use-tcp") if get_testuid() != get_rootuid(): - test_skipped("the /./ inner-module chroot regression requires root") + test_skipped("the /./ inner-module chroot regression requires root", capability='root') claim_ports(PORT) base = SCRATCHDIR / 'chroot-basis-forge' diff --git a/testsuite/tests/daemon-chroot-acl_test.py b/testsuite/tests/daemon-chroot-acl_test.py index f477145e..e66643e0 100644 --- a/testsuite/tests/daemon-chroot-acl_test.py +++ b/testsuite/tests/daemon-chroot-acl_test.py @@ -29,7 +29,8 @@ require_tcp("needs a real TCP peer address for reverse-DNS hostname ACL; " "run with --use-tcp") if platform.system() != 'Linux': - test_skipped("test is Linux-specific (uses chroot+unshare)") + test_skipped("test is Linux-specific (uses chroot+unshare)", + capability='linux_nss_chroot') # Need CAP_SYS_CHROOT. Re-exec under a user namespace if not root. def _can_chroot() -> bool: @@ -56,7 +57,8 @@ if not _can_chroot(): sys.executable, __file__], env, ) - test_skipped("need CAP_SYS_CHROOT (root or unshare --user --map-root-user)") + test_skipped("need CAP_SYS_CHROOT (root or unshare --user --map-root-user)", + capability='chroot') # Find what 127.0.0.1 reverse-resolves to. @@ -74,7 +76,7 @@ def _client_hostname() -> str: client_hostname = _client_hostname() if not client_hostname or client_hostname == '127.0.0.1': - test_skipped("no reverse DNS for 127.0.0.1") + test_skipped("no reverse DNS for 127.0.0.1", capability='linux_nss_chroot') chrootdir = SCRATCHDIR / 'chroot' rmtree(chrootdir) diff --git a/testsuite/tests/daemon-symlink-escape-matrix_test.py b/testsuite/tests/daemon-symlink-escape-matrix_test.py index 3effa721..3249f8a4 100644 --- a/testsuite/tests/daemon-symlink-escape-matrix_test.py +++ b/testsuite/tests/daemon-symlink-escape-matrix_test.py @@ -62,12 +62,14 @@ PWNED = "WROTE-THROUGH-LINK\n" require_tcp("the daemon symlink-resolution flow needs a real TCP peer") if os.geteuid() != 0: - test_skipped("requires root to plant a foreign-owned symlink and serve as root") + test_skipped("requires root to plant a foreign-owned symlink and serve as root", + capability='root') if not rsync_supports('--copy-dirlinks'): test_skipped("rsync lacks --copy-dirlinks") ATT = find_attacker_uid() if ATT is None: - test_skipped("no untrusted-uid user available for the cross-uid plant") + test_skipped("no untrusted-uid user available for the cross-uid plant", + capability='cross_uid') # The 3.2.7 oracle: prefer a --rsync-bin2 peer if it differs from the build under # test, else the in-tree static binary. None -> degrade to the static contract. diff --git a/testsuite/tests/daemon-zstd-thread-exhaustion_test.py b/testsuite/tests/daemon-zstd-thread-exhaustion_test.py index 83d662cd..7ce64ab9 100644 --- a/testsuite/tests/daemon-zstd-thread-exhaustion_test.py +++ b/testsuite/tests/daemon-zstd-thread-exhaustion_test.py @@ -112,7 +112,7 @@ if thread_count(child_pid) < 0: c.close() test_skipped("counting a process's threads is unsupported on " f'{sys.platform}, so a bound on the worker pool cannot be ' - 'observed here') + 'observed here', capability='thread_count') observed = 0 for _ in range(100):