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
18 changes: 17 additions & 1 deletion test/modules/http3/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,29 @@ 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")
# a module built into httpd (--enable-http3=static) is in its binary,
# and a mod_http3.so left in LIBEXEC_DIR is not the one in use
if "http3" in self.static_modules():
path = os.path.join(self.bin_dir, "httpd")
else:
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 built_with_asan(self) -> bool:
"""Whether httpd is AddressSanitizer instrumented: its quarantine of
freed memory grows RSS by far more than anything a test measuring
memory could tell from a leak."""
try:
with open(os.path.join(self.bin_dir, "httpd"), "rb") as fd:
return b"__asan_init" 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: 1 addition & 1 deletion test/modules/http3/test_016_cid_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ 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")
pytest.xfail("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
7 changes: 6 additions & 1 deletion test/modules/http3/test_017_listen_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest

from .env import H3Conf
from .env import H3Conf, known_bug

# All of 127.0.0.0/8 is local on Linux, so a second loopback address shows
# whether HTTP/3 answers on an address httpd was not told to listen on.
Expand Down Expand Up @@ -106,6 +106,11 @@ def test_h3_017_02_wildcard(self, env):
assert env.wait_udp_port(port)
for addr in ["127.0.0.1", OTHER_ADDR]:
r = get(env, port, addr)
if addr == OTHER_ADDR and env.h3_ossl_backend:
# OpenSSL QUIC sends from the address the kernel picks, not
# from the one the client sent to, so the client drops it
known_bug(r.exit_code != 0, f"OpenSSL QUIC replies to {addr} "
"from another source address")
assert r.exit_code == 0, f"{addr}: {r}"
assert r.response["status"] == 200

Expand Down
2 changes: 2 additions & 0 deletions test/modules/http3/test_112_stream_reclaim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class TestStreamReclaim:
@pytest.fixture(autouse=True, scope="class")
@classmethod
def _class_scope(cls, env):
if env.built_with_asan:
pytest.skip("RSS is not a measure of memory use under ASan")
H3Conf(env).add_h3_vhost().install()
assert env.apache_restart() == 0

Expand Down
Loading