You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/11/30 17:10:13 UTC
svn commit: r1895434 - in /httpd/httpd/trunk/test: modules/http2/test_700_load_get.py pyhttpd/env.py
Author: icing
Date: Tue Nov 30 17:10:13 2021
New Revision: 1895434
URL: http://svn.apache.org/viewvc?rev=1895434&view=rev
Log:
* test: check the h2load version for test suite making use
of its --connect-to feature (available since 1.41.0).
Modified:
httpd/httpd/trunk/test/modules/http2/test_700_load_get.py
httpd/httpd/trunk/test/pyhttpd/env.py
Modified: httpd/httpd/trunk/test/modules/http2/test_700_load_get.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_700_load_get.py?rev=1895434&r1=1895433&r2=1895434&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_700_load_get.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_700_load_get.py Tue Nov 30 17:10:13 2021
@@ -1,8 +1,10 @@
import pytest
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
+@pytest.mark.skipif(not H2TestEnv().h2load_is_at_least('1.41.0'),
+ reason="h2load misses --connect-to option")
class TestLoadGet:
@pytest.fixture(autouse=True, scope='class')
Modified: httpd/httpd/trunk/test/pyhttpd/env.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/pyhttpd/env.py?rev=1895434&r1=1895433&r2=1895434&view=diff
==============================================================================
--- httpd/httpd/trunk/test/pyhttpd/env.py (original)
+++ httpd/httpd/trunk/test/pyhttpd/env.py Tue Nov 30 17:10:13 2021
@@ -182,7 +182,11 @@ class HttpdTestEnv:
self._curl = self.config.get('global', 'curl_bin')
self._nghttp = self.config.get('global', 'nghttp')
+ if self._nghttp is None:
+ self._nghttp = 'nghttp'
self._h2load = self.config.get('global', 'h2load')
+ if self._h2load is None:
+ self._h2load = 'h2load'
self._http_port = int(self.config.get('test', 'http_port'))
self._https_port = int(self.config.get('test', 'https_port'))
@@ -382,6 +386,19 @@ class HttpdTestEnv:
def has_h2load(self):
return self._h2load != ""
+ def h2load_is_at_least(self, minv):
+ if not self.has_h2load():
+ return False
+ p = subprocess.run([self._h2load, '--version'], capture_output=True, text=True)
+ if p.returncode != 0:
+ return False
+ s = p.stdout.strip()
+ m = re.match(r'h2load nghttp2/(\S+)', s)
+ if m:
+ hv = self._versiontuple(m.group(1))
+ return hv >= self._versiontuple(minv)
+ return False
+
def has_nghttp(self):
return self._nghttp != ""