From: Joe Orton Date: Fri, 7 Aug 2026 14:22:39 +0000 (+0000) Subject: * test/pyhttpd/env.py (has_h2load): Verify h2load actually resolves, X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d657c6cc3912c90f2de6fc7e717b2b316859faf;p=thirdparty%2Fapache%2Fhttpd.git * test/pyhttpd/env.py (has_h2load): Verify h2load actually resolves, instead of just checking the config string is non-empty. Assisted-by: Claude Sonnet 5 GitHub: PR #701 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936973 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/pyhttpd/env.py b/test/pyhttpd/env.py index e3cf1e7231..a3e020dd99 100644 --- a/test/pyhttpd/env.py +++ b/test/pyhttpd/env.py @@ -508,7 +508,15 @@ class HttpdTestEnv: return hv >= self._versiontuple(minv) def has_h2load(self): - return self._h2load != "" + if self._h2load == "": + return False + # config.ini/default may just be the bare command name ("h2load"), + # not a verified path -- confirm it actually resolves so + # h2load_is_at_least() below doesn't crash with FileNotFoundError + # (breaking test collection) when the tool isn't installed. + if os.path.dirname(self._h2load): + return os.path.isfile(self._h2load) and os.access(self._h2load, os.X_OK) + return self.has_tool(self._h2load) def h2load_is_at_least(self, minv): if not self.has_h2load():