summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2023-05-02 09:03:32 +0000
committerStefan Eissing <icing@apache.org>2023-05-02 09:03:32 +0000
commit499480e507008626581ab64cd0e49cdcc5b4a1fe (patch)
treef37250a3e5993de36a57b66b442caa0bad2be39b
parent918620a183d843fb393ed939423a25d42c1044ec (diff)
downloadhttpd-499480e507008626581ab64cd0e49cdcc5b4a1fe.tar.gz
*) test: check for recent curl version in proxy tests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909560 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--test/modules/proxy/test_01_http.py2
-rw-r--r--test/modules/proxy/test_02_unix.py2
-rw-r--r--test/pyhttpd/env.py15
3 files changed, 19 insertions, 0 deletions
diff --git a/test/modules/proxy/test_01_http.py b/test/modules/proxy/test_01_http.py
index 7763565242..ef71b16e47 100644
--- a/test/modules/proxy/test_01_http.py
+++ b/test/modules/proxy/test_01_http.py
@@ -59,6 +59,8 @@ class TestProxyHttp:
# check that we see the document we expect there (host matching worked)
# we need to explicitly provide a Host: header since mod_proxy cannot
# resolve the name via DNS.
+ if not env.curl_is_at_least('8.0.0'):
+ pytest.skip(f'need at least curl v8.0.0 for this')
domain = f"{via}.{env.http_tld}"
r = env.curl_get(f"http://127.0.0.1:{env.http_port}/alive.json", 5, options=[
'-H', f"Host: {domain}",
diff --git a/test/modules/proxy/test_02_unix.py b/test/modules/proxy/test_02_unix.py
index a66cdf7462..7f3d4d55b2 100644
--- a/test/modules/proxy/test_02_unix.py
+++ b/test/modules/proxy/test_02_unix.py
@@ -110,6 +110,8 @@ class TestProxyUds:
# check that we see the document we expect there (host matching worked)
# we need to explicitly provide a Host: header since mod_proxy cannot
# resolve the name via DNS.
+ if not env.curl_is_at_least('8.0.0'):
+ pytest.skip(f'need at least curl v8.0.0 for this')
domain = f"{via}.{env.http_tld}"
r = env.curl_get(f"http://127.0.0.1:{env.http_port}/alive.json", 5, options=[
'-H', f"Host: {domain}",
diff --git a/test/pyhttpd/env.py b/test/pyhttpd/env.py
index 0f21e73b7a..818f18a5c4 100644
--- a/test/pyhttpd/env.py
+++ b/test/pyhttpd/env.py
@@ -287,6 +287,7 @@ class HttpdTestEnv:
self._verify_certs = False
self._curl_headerfiles_n = 0
+ self._curl_version = None
self._h2load_version = None
self._current_test = None
@@ -472,6 +473,20 @@ class HttpdTestEnv:
return self._h2load_version >= self._versiontuple(minv)
return False
+ def curl_is_at_least(self, minv):
+ if self._curl_version is None:
+ p = subprocess.run([self._curl, '-V'], capture_output=True, text=True)
+ if p.returncode != 0:
+ return False
+ for l in p.stdout.splitlines():
+ m = re.match(r'curl ([0-9.]+)[- ].*', l)
+ if m:
+ self._curl_version = self._versiontuple(m.group(1))
+ break
+ if self._curl_version is not None:
+ return self._curl_version >= self._versiontuple(minv)
+ return False
+
def has_nghttp(self):
return self._nghttp != ""