svn commit: r1936973 - httpd/httpd/trunk/test/pyhttpd
| Newsgroups | gmane.comp.apache.cvs |
|---|---|
| Message-ID | <178611255998.3596744.14726187148708333655@svn03-he-fi> |
Author: jorton Date: Fri Aug 7 14:22:39 2026 New Revision: 1936973 Log: * 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 <[email protected]> GitHub: PR #701 Modified: httpd/httpd/trunk/test/pyhttpd/env.py Modified: httpd/httpd/trunk/test/pyhttpd/env.py ============================================================================== --- httpd/httpd/trunk/test/pyhttpd/env.py Fri Aug 7 14:21:35 2026 (r1936972) +++ httpd/httpd/trunk/test/pyhttpd/env.py Fri Aug 7 14:22:39 2026 (r1936973) @@ -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():