To allow running pytests on more curl configurations.
Also delete a redundant H3 feature check from test_17_14_expired_cert.
Cherry-picked from #19407
Closes #19412
# simple https: GET, h2 wanted and got
@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL")
def test_01_03_h2_get(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://{env.domain1}:{env.https_port}/data.json'
r = curl.http_get(url=url, extra_args=['--http2'])
# simple https: GET, h2 unsupported, fallback to h1
@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL")
def test_01_04_h2_unsupported(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://{env.domain2}:{env.https_port}/data.json'
r = curl.http_get(url=url, extra_args=['--http2'])
@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL")
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_01_06_timings(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL")
def test_01_07_head(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# http: GET for HTTP/2, see Upgrade:, 101 switch
def test_01_08_h2_upgrade(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'http://{env.domain1}:{env.http_port}/data.json'
r = curl.http_get(url=url, extra_args=['--http2'])
# http: GET for HTTP/2 with prior knowledge
def test_01_09_h2_prior_knowledge(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'http://{env.domain1}:{env.http_port}/data.json'
r = curl.http_get(url=url, extra_args=['--http2-prior-knowledge'])
# http: strip TE header in HTTP/2 requests
def test_01_10_te_strip(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://{env.authority_for(env.domain1, "h2")}/data.json'
r = curl.http_get(url=url, extra_args=['--http2', '-H', 'TE: gzip'])
# RSTing the stream correctly when its internal limits are exceeded.
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_01_11_large_resp_headers(self, env: Env, httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
reason='httpd must be at least 2.4.64')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_01_12_xlarge_resp_headers(self, env: Env, httpd, configures_httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
httpd.set_extra_config('base', [
f'H2MaxHeaderBlockLen {130 * 1024}',
])
reason='httpd must be at least 2.4.64')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_01_13_megalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
httpd.set_extra_config('base', [
'LogLevel http2:trace2',
f'H2MaxHeaderBlockLen {130 * 1024}',
reason='httpd must be at least 2.4.64')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_01_14_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
httpd.set_extra_config('base', [
'LogLevel http2:trace2',
f'H2MaxHeaderBlockLen {1024 * 1024}',
reason='httpd must be at least 2.4.64')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_01_15_gigalarge_resp_headers(self, env: Env, httpd, configures_httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
httpd.set_extra_config('base', [
'LogLevel http2:trace2',
f'H2MaxHeaderBlockLen {1024 * 1024}',
# http: invalid request headers, GET, issue #16998
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_01_16_inv_req_get(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
])
def test_01_17_TE(self, env: Env, httpd, te_in, te_out):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo'
r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True,
# check that an existing https: connection is not reused for http:
def test_01_18_tls_reuse(self, env: Env, httpd):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url1 = f'https://{env.authority_for(env.domain1, proto)}/data.json'
url2 = f'http://{env.authority_for(env.domain1, proto)}/data.json'
# check that an existing http: connection is not reused for https:
def test_01_19_plain_reuse(self, env: Env, httpd):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url1 = f'http://{env.domain1}:{env.http_port}/data.json'
url2 = f'https://{env.domain1}:{env.http_port}/data.json'
# download 1 file
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_01_download_1(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# download 2 files
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_02_download_2(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# download 100 files sequentially
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_03_download_sequential(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if (proto == 'http/1.1' or proto == 'h2') and env.curl_uses_lib('mbedtls') and \
# download 100 files parallel
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_04_download_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h2' and env.curl_uses_lib('mbedtls') and \
# download 500 files sequential
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_05_download_many_sequential(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h2' and env.curl_uses_lib('mbedtls') and \
# download 500 files parallel
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_06_download_many_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h2' and env.curl_uses_lib('mbedtls') and \
# download files parallel, check connection reuse/multiplex
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_07_download_reuse(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 200
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_08_1MB_serial(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_09_1MB_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 3
@pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 3
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_12_head_serial_https(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.parametrize("proto", ['h2'])
def test_02_13_head_serial_h2c(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_14_not_found(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 5
@pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
def test_02_20_h2_small_frames(self, env: Env, httpd, configures_httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
# Test case to reproduce content corruption as observed in
# https://github.com/curl/curl/issues/10525
# To reliably reproduce, we need an Apache httpd that supports
@pytest.mark.parametrize("swin_max", [0, 10*1024])
def test_02_21_h2_lib_serial(self, env: Env, httpd, pause_offset, swin_max):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 2
docname = 'data-10m'
url = f'https://localhost:{env.https_port}/{docname}'
@pytest.mark.parametrize("pause_offset", [100*1023])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_offset):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
# download, several at a time, pause and abort paused
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# download, several at a time, abort after n bytes
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# download, several at a time, abort after n bytes
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# speed limited download
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_24_speed_limit(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# TODO: just uses a single connection for h2/h3. Not sure how to prevent that
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
url = f'https://{env.authority_for(env.domain1, proto)}/data-100k'
# test on paused transfers, based on issue #11982
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
url = f'https://{env.authority_for(env.domain1, proto)}' \
# test on paused transfers, based on issue #11982
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_27b_paused_no_cl(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
url = f'https://{env.authority_for(env.domain1, proto)}' \
# test on paused transfers, based on issue #11982
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_27c_paused_no_cl(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
url = f'https://{env.authority_for(env.domain1, proto)}' \
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, proto):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
@pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
# download parallel with prior knowledge
def test_02_30_parallel_prior_knowledge(self, env: Env, httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 3
curl = CurlClient(env=env)
urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]'
# download parallel with h2 "Upgrade:"
def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 3
curl = CurlClient(env=env)
urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]'
def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto):
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
pytest.skip('only works for curl debug builds')
if not env.curl_is_verbose():
pytest.skip('only works for curl with verbose strings')
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 50
pytest.skip('only works for curl debug builds')
if not env.curl_is_verbose():
pytest.skip('only works for curl with verbose strings')
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 50
# to be received, requiring buffering.
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_35_pause_bomb(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
@pytest.mark.parametrize("url_junk", [1024, 16*1024, 32*1024, 64*1024, 80*1024, 96*1024])
def test_02_36_looong_urls(self, env: Env, httpd, nghttpx, proto, url_junk):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_lib('quiche'):
# download files sequentially with delay, reload server for GOAWAY
def test_03_01_h2_goaway(self, env: Env, httpd, nghttpx):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 3
self.r = None
# download 1 file, check that delayed response works in general
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_04_01_download_1(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# (Apache2 increases # of parallel processed requests after successes)
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_04_02_100_100_10(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 50
# (Apache2 increases # of parallel processed requests after successes)
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_04_03_1000_10_1(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 50
# (Apache2 increases # of parallel processed requests after successes)
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_04_04_1000_10_1(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 50
# download 1 file, check that we get CURLE_PARTIAL_FILE
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_05_01_partial_1(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# download files, check that we get CURLE_PARTIAL_FILE for all
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# access a resource that, on h2, RST the stream with HTTP_1_1_REQUIRED
def test_05_03_required(self, env: Env, httpd, nghttpx):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
proto = 'http/1.1'
urln = f'https://{env.authority_for(env.domain1, proto)}/curltest/1_1'
# and not see the "unclean" close either
@pytest.mark.parametrize("proto", ['http/1.0', 'http/1.1', 'h2'])
def test_05_04_unclean_tls_shutdown(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 10 if proto == 'h2' else 1
# upload small data, check that this is what was echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_01_upload_1_small(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
data = '0123456789'
# upload large data, check that this is what was echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_02_upload_1_large(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-100k')
# upload data sequentially, check that they were echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_10_upload_sequential(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 20
# upload data parallel, check that they were echoed
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_07_11_upload_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
# limit since we use a separate connection in h1
# upload large data sequentially, check that this is what was echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_12_upload_seq_large(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-100k')
# upload very large data sequentially, check that this is what was echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_13_upload_seq_large(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
'', '1', '123\n456andsomething\n\n'
])
def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
# upload data parallel, check that they were echoed
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_07_20_upload_parallel(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
# limit since we use a separate connection in h1
# upload large data parallel, check that this is what was echoed
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_07_21_upload_parallel_large(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-100k')
# upload large data parallel to a URL that denies uploads
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_07_22_upload_parallel_fail(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
# PUT 100k
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_30_put_100k(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-100k')
# PUT 10m
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_31_put_10m(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
# issue #10591
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_32_issue_10591(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
# correctly and not time out on sending
def test_07_33_issue_11157a(self, env: Env, httpd, nghttpx):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
# send a POST to our PUT handler which will send immediately a 404 back
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put'
# issue #11157, send upload that is slowly read in
def test_07_33_issue_11157b(self, env: Env, httpd, nghttpx):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
# tell our test PUT handler to read the upload more slowly, so
# that the send buffering and transfer loop needs to wait
def test_07_34_issue_11194(self, env: Env, httpd, nghttpx):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
# tell our test PUT handler to read the upload more slowly, so
# that the send buffering and transfer loop needs to wait
fdata = os.path.join(env.gen_dir, 'data-100k')
# upload large data on a h1 to h2 upgrade
def test_07_35_h1_h2_upgrade_upload(self, env: Env, httpd, nghttpx):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
fdata = os.path.join(env.gen_dir, 'data-100k')
curl = CurlClient(env=env)
url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]'
@pytest.mark.parametrize("redir", ['301', '302', '303'])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_36_upload_30x(self, env: Env, httpd, nghttpx, redir, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# upload to a 307 response
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_37_upload_307(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
# POST form data, yet another code path in transfer
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_38_form_small(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# POST data urlencoded, small enough to be sent with request headers
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_39_post_urlenc_small(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-63k')
# POST data urlencoded, large enough to be sent separate from request headers
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_40_post_urlenc_large(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
fdata = os.path.join(env.gen_dir, 'data-64k')
# of the time
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_41_post_urlenc_small(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_lib('quiche'):
# issues #11769 #13260
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
client = LocalClient(name='cli_upload_pausing', env=env, timeout=60)
# upload data, pause, let connection die without any response at all
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
client = LocalClient(name='cli_upload_pausing', env=env, timeout=60)
# upload data, pause, let connection die after 100 continue
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
client = LocalClient(name='cli_upload_pausing', env=env, timeout=60)
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
@pytest.mark.parametrize("httpcode", [301, 302, 307, 308])
def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# speed limited on put handler
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_50_put_speed_limit(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# speed limited on echo handler
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_07_51_echo_speed_limit(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early):
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
# download 1 file
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_01_download_1(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
curl = CurlClient(env=env)
# download 1MB files sequentially
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_02_download_1mb_sequential(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
count = 50
# download 1MB files parallel
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_03_download_1mb_parallel(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
count = 20
@pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
count = 40
@pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
count = 20
@pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3_curl():
pytest.skip("h3 not supported in curl")
if proto == 'http/1.1' and env.curl_uses_lib('mbedtls'):
# post data parallel, check that they were echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_06_post_parallel(self, env: Env, httpd, caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
# limit since we use a separate connection in h1
# put large file, check that they length were echoed
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_07_put_large(self, env: Env, httpd, caddy, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
# limit since we use a separate connection in h1<
def test_08_08_earlydata(self, env: Env, httpd, caddy, proto):
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
# download a file that triggers a "103 Early Hints" response
def test_09_01_h2_early_hints(self, env: Env, httpd, configures_httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
self.httpd_configure(env, httpd)
curl = CurlClient(env=env)
url = f'https://{env.domain1}:{env.https_port}/push/data1'
assert r.responses[0]['header']['link'] == '</push/data2>; rel=preload', f'{r.responses[0]}'
def test_09_02_h2_push(self, env: Env, httpd, configures_httpd):
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
self.httpd_configure(env, httpd)
# use localhost as we do not have resolve support in local client
url = f'https://localhost:{env.https_port}/push/data1'
reason='curl lacks HTTPS-proxy support')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_10_02_proxys_down(self, env: Env, httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
reason="no nghttpx available")
def test_10_02_proxys_up(self, env: Env, httpd, nghttpx, proto,
fname, fcount):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
count = fcount
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL")
def test_10_05_proxytunnel_http(self, env: Env, httpd, nghttpx_fwd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://localhost:{env.https_port}/data.json'
xargs = curl.get_proxy_args(proxys=False, tunnel=True)
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_06_proxytunnel_https(self, env: Env, httpd, nghttpx_fwd, proto, tunnel):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available")
def test_10_07_pts_down_small(self, env: Env, httpd, nghttpx_fwd, proto,
tunnel, fname, fcount):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
if env.curl_uses_lib('mbedtls') and \
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available")
def test_10_08_upload_seq_large(self, env: Env, httpd, nghttpx, proto,
tunnel, fname, fcount):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
if env.curl_uses_lib('mbedtls') and \
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_09_reuse_server(self, env: Env, httpd, nghttpx_fwd, tunnel):
+ if tunnel == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel):
# url twice via https: proxy separated with '--next', will reuse
+ if tunnel == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
if env.curl_uses_lib('mbedtls') and \
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_11_noreuse_proxy_https(self, env: Env, httpd, nghttpx_fwd, tunnel):
# different --proxy-tls13-ciphers, no reuse of connection for https:
+ if tunnel == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_12_noreuse_proxy_http(self, env: Env, httpd, nghttpx_fwd, tunnel):
# different --proxy-tls13-ciphers, no reuse of connection for http:
+ if tunnel == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
def test_10_13_noreuse_https(self, env: Env, httpd, nghttpx_fwd, tunnel):
# different --tls13-ciphers on https: same proxy config
+ if tunnel == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
reason='curl lacks HTTPS-proxy support')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_10_14_proxys_ip_addr(self, env: Env, httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
curl = CurlClient(env=env)
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
@pytest.mark.parametrize("tunnel", ['http/1.1', 'h2'])
def test_13_07_tunnels_no_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
self.httpd_configure(env, httpd)
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
@pytest.mark.parametrize("tunnel", ['http/1.1', 'h2'])
def test_13_08_tunnels_auth(self, env: Env, httpd, configures_httpd, nghttpx_fwd, proto, tunnel):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
self.httpd_configure(env, httpd)
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
pytest.skip('only supported with nghttp2')
# download 1 file, not authenticated
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_14_01_digest_get_noauth(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
def test_14_02_digest_get_auth(self, env: Env, httpd, nghttpx, proto):
if not env.curl_has_feature('digest'):
pytest.skip("curl built without digest")
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto):
if not env.curl_has_feature('digest'):
pytest.skip("curl built without digest")
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_ossl_quic():
def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto):
if not env.curl_has_feature('digest'):
pytest.skip("curl built without digest")
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
data='0123456789'
# PUT data, basic auth large pw
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and not env.curl_uses_lib('ngtcp2'):
# PUT data, basic auth with very large pw
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_14_06_basic_very_large_pw(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if proto == 'h3' and env.curl_uses_lib('quiche'):
# download plain file
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_16_01_info_download(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
# download plain file with a 302 redirect
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_16_02_info_302_download(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 2
# use host name with trailing dot, verify handshake
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# use host name with double trailing dot, verify handshake
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
def test_17_05_good_ip_addr(self, env: Env, proto, httpd, nghttpx):
if env.curl_uses_lib('mbedtls'):
pytest.skip("mbedTLS does use IP addresses in SNI")
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
def test_17_05_bad_ip_addr(self, env: Env, proto,
httpd, configures_httpd,
nghttpx, configures_nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
httpd.set_domain1_cred_name('domain1-no-ip')
def test_17_05_very_bad_ip_addr(self, env: Env, proto,
httpd, configures_httpd,
nghttpx, configures_nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if env.curl_uses_lib('mbedtls'):
# use localhost for connect
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_06_localhost(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_08_cert_status(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if not env.curl_uses_lib('openssl') and \
# use host name server has no certificate for
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# use host name server has no cert for with --insecure
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# connect to an expired certificate
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_17_14_expired_cert(self, env: Env, proto, httpd):
- if proto == 'h3' and not env.have_h3():
- pytest.skip("h3 not supported")
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
curl = CurlClient(env=env)
url = f'https://{env.expired_domain}:{env.port_for(proto)}/'
r = curl.http_get(url=url, alpn_proto=proto)
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_19_wrong_pin(self, env: Env, proto, httpd):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if env.curl_uses_lib('rustls-ffi'):
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_17_20_correct_pin(self, env: Env, proto, httpd):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env)
# download 1 file
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_18_01_delete(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
count = 1
# should be accepted
def test_18_02_delete_h2_special(self, env: Env, httpd, nghttpx):
proto = 'h2'
+ if not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 1
curl = CurlClient(env=env)
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak?id=[0-{count-1}]'\
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_19_02_check_shutdown(self, env: Env, httpd, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if not env.curl_is_debug():
pytest.skip('only works for curl debug builds')
run_env = os.environ.copy()
# check graceful shutdown on multiplexed http
@pytest.mark.parametrize("proto", ['h2', 'h3'])
def test_19_06_check_shutdown(self, env: Env, httpd, nghttpx, proto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if not env.curl_is_debug():
@pytest.mark.parametrize("sproto", ['socks4', 'socks5'])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_40_02_socks_https(self, env: Env, sproto, proto, danted: Dante, httpd):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
curl = CurlClient(env=env, socks_args=[
@pytest.mark.parametrize("sproto", ['socks4', 'socks5'])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_40_03_dl_serial(self, env: Env, httpd, danted, proto, sproto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
count = 3
urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]'
curl = CurlClient(env=env, socks_args=[
@pytest.mark.parametrize("sproto", ['socks4', 'socks5'])
@pytest.mark.parametrize("proto", ['http/1.1', 'h2'])
def test_40_04_ul_serial(self, env: Env, httpd, danted, proto, sproto):
+ if proto == 'h2' and not env.have_h2_curl():
+ pytest.skip("h2 not supported")
fdata = os.path.join(env.gen_dir, 'data-10m')
count = 2
curl = CurlClient(env=env, socks_args=[