From c2b8e4532bf8b010d8e45f219224408a30f3fa41 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Jun 2026 18:59:18 +1000 Subject: [PATCH] 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). --- testsuite/fleettest.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/testsuite/fleettest.py b/testsuite/fleettest.py index dc2295b5..b200604a 100755 --- a/testsuite/fleettest.py +++ b/testsuite/fleettest.py @@ -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()