Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/modules/dav/test_004_lock_timeout_overflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import glob
import os
import re

Expand Down Expand Up @@ -32,6 +33,11 @@ def _class_scope(self, env):
with open(os.path.join(dav_dir, name), 'w') as fd:
fd.write('hello\n')

# the locks outlive the server: file1.txt stays locked for 2^32-1
# seconds, so a lock database left by an earlier run answers 423
for f in glob.glob(f"{env.gen_dir}/davlock-timeout-overflow*"):
os.remove(f)

conf = HttpdConf(env, extras={
'base': f"""
DavLockDB "{env.gen_dir}/davlock-timeout-overflow"
Expand Down
12 changes: 12 additions & 0 deletions test/modules/http3/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ def __init__(self, pytestconfig=None):
def setup_httpd(self, setup: HttpdTestSetup = None):
super().setup_httpd(setup=H3TestSetup(env=self))

@property
def h3_ossl_backend(self) -> bool:
"""Whether mod_http3 runs on OpenSSL's own QUIC stack
(--with-http3-quic=openssl) and not on ngtcp2, which has no 0-RTT,
connection ID routing or connection migration."""
path = os.path.join(self.LIBEXEC_DIR, "mod_http3.so")
try:
with open(path, "rb") as fd:
return b"ngtcp2" not in fd.read()
except OSError:
return False

@property
def h3_port(self) -> int:
# the QUIC listener shares the number of the TLS port, over UDP
Expand Down
2 changes: 2 additions & 0 deletions test/modules/http3/test_016_cid_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class TestCidRouting:

@pytest.fixture(autouse=True, scope="class")
def _class_scope(self, env):
if env.h3_ossl_backend:
pytest.skip("routing by connection ID needs the ngtcp2 backend")
cpus = os.cpu_count() or 1
if cpus < 2:
pytest.skip("two buckets need two cores")
Expand Down
13 changes: 12 additions & 1 deletion test/modules/metadata/test_004_remoteip.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ def remote_port_install(self, env):
f"RemoteIPInternalProxy {self.PEER}"] + exposed)
conf.end_vhost()
conf.install()
# drop what an earlier test logged, so that remote_port_clear_log()
# waits for the probe of this restart and not for a stale line
open(os.path.join(env.server_logs_dir, self.LOG_FILE), 'w').close()
assert env.apache_restart() == 0

def remote_port_logged(self, env):
Expand All @@ -293,7 +296,15 @@ def remote_port_logged(self, env):
return lines[0]

def remote_port_clear_log(self, env):
open(os.path.join(env.server_logs_dir, self.LOG_FILE), 'w').close()
# The readiness probe of apache_restart() is logged after its
# response is sent, so it can land after the restart returned:
# wait for that line, or it would be taken for the test's own.
log_path = os.path.join(env.server_logs_dir, self.LOG_FILE)
for _ in range(20):
if os.path.getsize(log_path) > 0:
break
time.sleep(0.1)
open(log_path, 'w').close()

# PROXY protocol: the client's port is known (4321 in PP2_ADDRS) and
# every place must report it, not the proxy's TCP source port.
Expand Down
Loading