mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:43:35 +03:00
tests: check caddy server version to match test expectations
- new caddy servers no longer return 200 on POSTs, but 405 as they should Closes #13405
This commit is contained in:
parent
1634330474
commit
3e16c97fe9
2 changed files with 17 additions and 2 deletions
|
|
@ -168,7 +168,11 @@ class EnvConfig:
|
|||
if p.returncode != 0:
|
||||
# not a working caddy
|
||||
self.caddy = None
|
||||
self._caddy_version = re.sub(r' .*', '', p.stdout.strip())
|
||||
m = re.match(r'v?(\d+\.\d+\.\d+) .*', p.stdout)
|
||||
if m:
|
||||
self._caddy_version = m.group(1)
|
||||
else:
|
||||
raise f'Unable to determine cadd version from: {p.stdout}'
|
||||
except:
|
||||
self.caddy = None
|
||||
|
||||
|
|
@ -196,6 +200,12 @@ class EnvConfig:
|
|||
hv = self.versiontuple(self.httpd_version)
|
||||
return hv >= self.versiontuple(minv)
|
||||
|
||||
def caddy_is_at_least(self, minv):
|
||||
if self.caddy_version is None:
|
||||
return False
|
||||
hv = self.versiontuple(self.caddy_version)
|
||||
return hv >= self.versiontuple(minv)
|
||||
|
||||
def is_complete(self) -> bool:
|
||||
return os.path.isfile(self.httpd) and \
|
||||
os.path.isfile(self.apachectl) and \
|
||||
|
|
@ -318,6 +328,10 @@ class Env:
|
|||
def caddy_version() -> str:
|
||||
return Env.CONFIG.caddy_version
|
||||
|
||||
@staticmethod
|
||||
def caddy_is_at_least(minv) -> bool:
|
||||
return Env.CONFIG.caddy_is_at_least(minv)
|
||||
|
||||
@staticmethod
|
||||
def httpd_is_at_least(minv) -> bool:
|
||||
return Env.CONFIG.httpd_is_at_least(minv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue