testsuite: fall back to the static contract when the 3.2.7 oracle can't exec

daemon-symlink-escape-matrix prefers the in-tree old_versions/rsync_3.2.7 as its
legacy oracle, but that is a Linux x86-64 static binary.  On a full checkout (the
per-platform CI runners) it is present yet cannot exec on a BSD/macOS/Solaris host,
so start_test_daemon() crashed with OSError ENOEXEC and failed the test.  (The
git-archive fleet never hit this: .gitattributes export-ignores old_versions/, so
the binary is absent there and the test already took its static-contract path.)

Probe the selected oracle binary (rsync --version) and degrade to the static
contract on any OSError, the same path used when no oracle binary is present.
This commit is contained in:
Andrew Tridgell committed 2026-07-20 14:05:32 +10:00
1 parent 32ef91adcb
commit 88b4d77b18
1 file changed
+10
@@ -78,6 +78,16 @@ if RSYNC_PEER != RSYNC:
elif (_repo / 'old_versions' / 'rsync_3.2.7').is_file():
ORACLE_BIN = str(_repo / 'old_versions' / 'rsync_3.2.7')
# The in-tree oracle is a Linux x86-64 static binary, so on a non-Linux runner
# (BSD/macOS/Solaris) it is present but cannot exec. Probe it and degrade to the
# static contract on any exec failure rather than crashing with ENOEXEC.
if ORACLE_BIN:
try:
subprocess.run([ORACLE_BIN, '--version'],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=15)
except OSError:
ORACLE_BIN = None
TYPES = ('rel-within', 'rel-outside', 'rel-transits', 'abs-outside', 'abs-inside')
OUTSIDE = {'rel-outside', 'abs-outside'}
VECTORS = ('read', 'write', 'read-plain', 'write-plain', 'compare-dest')