diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 47f0417e79..fa2c002091 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -577,12 +577,10 @@ class TestDownload: @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): - if not env.curl_uses_lib('gnutls') and \ - not env.curl_uses_lib('wolfssl') and \ - not env.curl_uses_lib('quictls') and \ - not env.curl_uses_lib('openssl'): + if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') - if proto == 'h3' and not env.have_h3(): + if proto == 'h3' and \ + (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") count = 2 docname = 'data-10k' diff --git a/tests/http/test_07_upload.py b/tests/http/test_07_upload.py index b34d0c2f26..53e5a00a35 100644 --- a/tests/http/test_07_upload.py +++ b/tests/http/test_07_upload.py @@ -703,12 +703,10 @@ class TestUpload: # of 128K. ]) def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early): - if not env.curl_uses_lib('gnutls') and \ - not env.curl_uses_lib('wolfssl') and \ - not env.curl_uses_lib('quictls') and \ - not env.curl_uses_lib('openssl'): + if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') - if proto == 'h3' and not env.have_h3(): + if proto == 'h3' and \ + (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") count = 2 # we want this test to always connect to nghttpx, since it is diff --git a/tests/http/test_08_caddy.py b/tests/http/test_08_caddy.py index 776c0362cb..cd16e0d954 100644 --- a/tests/http/test_08_caddy.py +++ b/tests/http/test_08_caddy.py @@ -207,12 +207,10 @@ class TestCaddy: @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_08_earlydata(self, env: Env, httpd, caddy, proto): - if not env.curl_uses_lib('gnutls') and \ - not env.curl_uses_lib('wolfssl') and \ - not env.curl_uses_lib('quictls') and \ - not env.curl_uses_lib('openssl'): + if not env.curl_can_early_data(): pytest.skip('TLS earlydata not implemented') - if proto == 'h3' and not env.have_h3(): + if proto == 'h3' and \ + (not env.have_h3() or not env.curl_can_h3_early_data()): pytest.skip("h3 not supported") count = 2 docname = 'data10k.data' diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 3b13a5c6bf..a4ab7a9801 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -382,6 +382,18 @@ class Env: def curl_is_debug() -> bool: return Env.CONFIG.curl_is_debug + @staticmethod + def curl_can_early_data() -> bool: + return Env.curl_uses_lib('gnutls') or \ + Env.curl_uses_lib('wolfssl') or \ + Env.curl_uses_lib('quictls') or \ + Env.curl_uses_lib('openssl') + + @staticmethod + def curl_can_h3_early_data() -> bool: + return Env.curl_can_early_data() and \ + Env.curl_uses_lib('ngtcp2') + @staticmethod def have_h3() -> bool: return Env.have_h3_curl() and Env.have_h3_server()