unify tests for early data, check for ngtcp2 when testing h3
This commit is contained in:
parent
cbbdfd32e7
commit
da5453381f
@ -577,12 +577,10 @@ class TestDownload:
|
|||||||
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx")
|
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx")
|
||||||
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
|
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
|
||||||
def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto):
|
def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto):
|
||||||
if not env.curl_uses_lib('gnutls') and \
|
if not env.curl_can_early_data():
|
||||||
not env.curl_uses_lib('wolfssl') and \
|
|
||||||
not env.curl_uses_lib('quictls') and \
|
|
||||||
not env.curl_uses_lib('openssl'):
|
|
||||||
pytest.skip('TLS earlydata not implemented')
|
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")
|
pytest.skip("h3 not supported")
|
||||||
count = 2
|
count = 2
|
||||||
docname = 'data-10k'
|
docname = 'data-10k'
|
||||||
|
|||||||
@ -703,12 +703,10 @@ class TestUpload:
|
|||||||
# of 128K.
|
# of 128K.
|
||||||
])
|
])
|
||||||
def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early):
|
def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early):
|
||||||
if not env.curl_uses_lib('gnutls') and \
|
if not env.curl_can_early_data():
|
||||||
not env.curl_uses_lib('wolfssl') and \
|
|
||||||
not env.curl_uses_lib('quictls') and \
|
|
||||||
not env.curl_uses_lib('openssl'):
|
|
||||||
pytest.skip('TLS earlydata not implemented')
|
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")
|
pytest.skip("h3 not supported")
|
||||||
count = 2
|
count = 2
|
||||||
# we want this test to always connect to nghttpx, since it is
|
# we want this test to always connect to nghttpx, since it is
|
||||||
|
|||||||
@ -207,12 +207,10 @@ class TestCaddy:
|
|||||||
|
|
||||||
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
|
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
|
||||||
def test_08_08_earlydata(self, env: Env, httpd, caddy, proto):
|
def test_08_08_earlydata(self, env: Env, httpd, caddy, proto):
|
||||||
if not env.curl_uses_lib('gnutls') and \
|
if not env.curl_can_early_data():
|
||||||
not env.curl_uses_lib('wolfssl') and \
|
|
||||||
not env.curl_uses_lib('quictls') and \
|
|
||||||
not env.curl_uses_lib('openssl'):
|
|
||||||
pytest.skip('TLS earlydata not implemented')
|
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")
|
pytest.skip("h3 not supported")
|
||||||
count = 2
|
count = 2
|
||||||
docname = 'data10k.data'
|
docname = 'data10k.data'
|
||||||
|
|||||||
@ -382,6 +382,18 @@ class Env:
|
|||||||
def curl_is_debug() -> bool:
|
def curl_is_debug() -> bool:
|
||||||
return Env.CONFIG.curl_is_debug
|
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
|
@staticmethod
|
||||||
def have_h3() -> bool:
|
def have_h3() -> bool:
|
||||||
return Env.have_h3_curl() and Env.have_h3_server()
|
return Env.have_h3_curl() and Env.have_h3_server()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user