]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
fleettest: require runtests.py in --testsuite-repo, not the build tree
authorAndrew Tridgell <andrew@tridgell.net>
Sun, 7 Jun 2026 08:59:18 +0000 (18:59 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Sun, 7 Jun 2026 20:29:49 +0000 (06:29 +1000)
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

index dc2295b584ca8bfe2ff022c031108b9ba3fa2340..b200604a13764fc8a5bfaeff203a4d31163afb78 100755 (executable)
@@ -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()