fleettest: require runtests.py in --testsuite-repo, not the build tree

When --testsuite-repo provides the suite, the build tree (--repo) need not
carry runtests.py -- it may be an older release whose shell testsuite predates
the Python runtests.py (e.g. a 3.4.1 backport branch built and tested with the
current suite).  Check runtests.py in TESTSUITE_REPO and only require the build
tree to be rsync source (rsync.h).
This commit is contained in:
Andrew Tridgell
2026-06-07 18:59:18 +10:00
parent 7b66c0665f
commit c2b8e4532b

View File

@@ -835,11 +835,19 @@ def main() -> int:
# tree that provides the tests.
WORKFLOWS = TESTSUITE_REPO / ".github" / "workflows"
if not args.cleanup:
for label, tree in (("--repo", REPO), ("--testsuite-repo", TESTSUITE_REPO)):
if not (tree / "runtests.py").is_file():
print(f"{tree} is not an rsync source tree (no runtests.py); "
f"run from inside a checkout or pass {label}", file=sys.stderr)
return 2
# The Python test suite (runtests.py + testsuite/) comes from
# TESTSUITE_REPO, so that is where runtests.py must live. The build tree
# (REPO) only has to be a buildable rsync source -- it may be an older
# release whose runtests.py predates the Python suite, or lacks it.
if not (TESTSUITE_REPO / "runtests.py").is_file():
print(f"{TESTSUITE_REPO} has no runtests.py; run from inside a "
f"checkout or pass --testsuite-repo a tree with the Python "
f"test suite", file=sys.stderr)
return 2
if not (REPO / "rsync.h").is_file():
print(f"{REPO} is not an rsync source tree (no rsync.h); "
f"run from inside a checkout or pass --repo", file=sys.stderr)
return 2
if args.fleet:
config_path = Path(args.fleet).resolve()