pytest: adapt for runs with openssl-1.1.1

Fix use of nghttpx fixture to be present even when h3 is not
available in curl. Fix TLS protocol versions expectations for
older openssl versions.

Closes #17538
This commit is contained in:
Stefan Eissing 2025-06-05 10:37:24 +02:00 committed by Daniel Stenberg
parent 5d9f425302
commit d9bebede59
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 70 additions and 22 deletions

View file

@ -36,6 +36,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
from testenv import Env, Nghttpx, Httpd, NghttpxQuic, NghttpxFwd
log = logging.getLogger(__name__)
def pytest_report_header(config):
# Env inits its base properties only once, we can report them here
@ -109,7 +111,9 @@ def httpd(env) -> Generator[Httpd, None, None]:
@pytest.fixture(scope='session')
def nghttpx(env, httpd) -> Generator[Union[Nghttpx,bool], None, None]:
nghttpx = NghttpxQuic(env=env)
if nghttpx.exists() and env.have_h3():
if nghttpx.exists():
if not nghttpx.supports_h3() and env.have_h3_curl():
log.warning('nghttpx does not support QUIC, but curl does')
nghttpx.clear_logs()
assert nghttpx.initial_start()
yield nghttpx