Fixing httpx requests with http2
It seems that passing http2=True is not longer enough to send an http2
request with httpx, http1=False needs to be passed as well
Change-Id: Ia748f8728a494799d34d7130df727b2055d04090
diff --git a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
index 62be835..7938c31 100644
--- a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
+++ b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py
@@ -1256,24 +1256,18 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
- # TODO(johnsom) - Remove this once eventlet is removed from OpenStack
- # NOTE(pas-ha): depending on what other tempest plugins are installed
- # the eventlet might've been imported by that time, and, since
- # dnspython 2.2.0, importing eventlet or any part of it effectively
- # instantiates a dummy httpx.Client instance, thus pinning the ssl
- # implementation in httpx to the eventlet's one.
- # This leads to error in the Client() call below, as the ssl lib in
- # this module is different from ssl lib in httpx._config,
- # which fails isinstance check for ssl.SSLContext.
- # Use the ssl module that is actually used by httpx to instantiate
- # the SSL context to be used with httpx.
- ssl = httpx._config.ssl
context = ssl.create_default_context(cadata=self.ca_cert.public_bytes(
serialization.Encoding.PEM).decode('utf-8'))
context.check_hostname = False
url = 'https://%s:%s' % (self.lb_vip_address, 443)
- client = httpx.Client(http2=(http_version == 'HTTP/2'), verify=context)
+ client_kwargs = {
+ 'verify': context
+ }
+ if http_version == 'HTTP/2':
+ client_kwargs['http1'] = False
+ client_kwargs['http2'] = True
+ client = httpx.Client(**client_kwargs)
r = client.get(url)
self.assertEqual(http_version, r.http_version)
if hsts:
diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml
index 41232fd..fee26dd 100644
--- a/zuul.d/projects.yaml
+++ b/zuul.d/projects.yaml
@@ -21,11 +21,10 @@
- octavia-v2-dsvm-scenario-non-traffic-ops-stable-2024-1
- octavia-v2-dsvm-scenario-traffic-ops-stable-2023-2
- octavia-v2-dsvm-scenario-non-traffic-ops-stable-2023-2
- # TODO(gthiemonge) Re-enable this later, httpx workaround is broken
- #- octavia-v2-dsvm-tls-barbican
- #- octavia-v2-dsvm-tls-barbican-stable-2024-2
- #- octavia-v2-dsvm-tls-barbican-stable-2024-1
- #- octavia-v2-dsvm-tls-barbican-stable-2023-2
+ - octavia-v2-dsvm-tls-barbican
+ - octavia-v2-dsvm-tls-barbican-stable-2024-2
+ - octavia-v2-dsvm-tls-barbican-stable-2024-1
+ - octavia-v2-dsvm-tls-barbican-stable-2023-2
- octavia-v2-dsvm-scenario-ipv6-only:
voting: false
- octavia-v2-dsvm-scenario-centos-9-stream-traffic-ops:
@@ -70,8 +69,7 @@
- octavia-v2-dsvm-scenario-non-traffic-ops-stable-2024-1
- octavia-v2-dsvm-scenario-traffic-ops-stable-2023-2
- octavia-v2-dsvm-scenario-non-traffic-ops-stable-2023-2
- # TODO(gthiemonge) Re-enable this later, httpx workaround is broken
- #- octavia-v2-dsvm-tls-barbican
- #- octavia-v2-dsvm-tls-barbican-stable-2024-2
- #- octavia-v2-dsvm-tls-barbican-stable-2024-1
- #- octavia-v2-dsvm-tls-barbican-stable-2023-2
+ - octavia-v2-dsvm-tls-barbican
+ - octavia-v2-dsvm-tls-barbican-stable-2024-2
+ - octavia-v2-dsvm-tls-barbican-stable-2024-1
+ - octavia-v2-dsvm-tls-barbican-stable-2023-2