testsuite: classify platform requirements

This commit is contained in:
Zen Dodd committed 2026-10-09 16:24:58 +10:00
1 parent 7c2a62c0b3
commit 1e341c69b0
6 files changed
+14 -7

No files matched your search

+2
View File
@@ -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"
+1
View File
@@ -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",
@@ -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'
+5 -3
View File
@@ -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)
@@ -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.
@@ -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):