url = f'https://{env.domain1}:{caddy.port}/data10.data?[0-{count-1}]'
r = curl.http_upload(urls=[url], data=data, alpn_proto=proto,
extra_args=['--parallel'])
- r.check_stats(count=count, http_status=200, exitcode=0)
+ exp_status = 405 if env.caddy_is_at_least('2.7.0') else 200
+ r.check_stats(count=count, http_status=exp_status, exitcode=0)
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
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 \
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)