# produce an error during response body
def test_h2_003_71(self, env, repeat):
- pytest.skip("needs fix in core protocol handling")
+ if env.httpd_is_at_least('2.5.0'):
+ pytest.skip("needs fix in core protocol handling")
url = env.mkurl("https", "cgi", "/h2test/error?body_error=timeout")
r = env.curl_get(url)
assert r.exit_code != 0, f"{r}"
# produce an error, fail to generate an error bucket
def test_h2_003_72(self, env, repeat):
- pytest.skip("needs fix in core protocol handling")
+ if env.httpd_is_at_least('2.5.0'):
+ pytest.skip("needs fix in core protocol handling")
url = env.mkurl("https", "cgi", "/h2test/error?body_error=timeout&error_bucket=0")
r = env.curl_get(url)
assert r.exit_code != 0, f"{r}"
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
TestPost._local_dir = os.path.dirname(inspect.getfile(TestPost))
- conf = H2Conf(env)
- conf.add_vhost_cgi(proxy_self=True, h2proxy_self=True).install()
+ conf = H2Conf(env, extras={
+ f'cgi.{env.http_tld}': [
+ f'<Directory {env.server_docs_dir}/cgi/xxx>',
+ ' RewriteEngine On',
+ ' RewriteRule .* /proxy/echo.py [QSA]',
+ '</Directory>',
+ ]
+ })
+ conf.add_vhost_cgi(proxy_self=True).install()
assert env.apache_restart() == 0
def local_src(self, fname):
def test_h2_004_41(self, env):
# reproduce PR66597, double chunked encoding on redirects
- conf = H2Conf(env, extras={
- f'cgi.{env.http_tld}': [
- f'<Directory {env.server_docs_dir}/cgi/xxx>',
- ' RewriteEngine On',
- ' RewriteRule .* /proxy/echo.py [QSA]',
- '</Directory>',
- ]
- })
- conf.add_vhost_cgi(proxy_self=True).install()
- assert env.apache_restart() == 0
url = env.mkurl("https", "cgi", "/xxx/test.json")
r = env.curl_post_data(url, data="0123456789", options=[])
assert r.exit_code == 0
r = env.curl_get(url, options=['-v'])
# requests should succeed, but rarely connections get closed
# before the response is received
- if r.exit_code == 55:
+ if r.exit_code in [16, 55]:
# curl send error
assert r.response is None
else:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
+ if not env.httpd_is_at_least('2.4.58'):
+ pytest.skip(f'needs httpd 2.4.58')
H2Conf(env).start_vhost(domains=[f"hints.{env.http_tld}"],
port=env.https_port, doc_root="htdocs/test1"
).add("""
# H2EarlyHints enabled, no PUSH, check that it works for H2EarlyHint
def test_h2_401_34(self, env, repeat):
+ if not env.httpd_is_at_least('2.4.58'):
+ pytest.skip(f'needs httpd 2.4.58')
url = env.mkurl("https", "hints", "/006-early-no-push.html")
r = env.nghttp().get(url)
assert r.response["status"] == 200
# produce an error during response body
def test_h2_600_31(self, env, repeat):
- pytest.skip("needs fix in core protocol handling")
+ if env.httpd_is_at_least('2.5.0'):
+ pytest.skip("needs fix in core protocol handling")
conf = H2Conf(env)
conf.add_vhost_cgi(h2proxy_self=True)
conf.install()
# depending on when the error is detect in proxying, if may RST the
# stream (exit_code != 0) or give a 503 response.
if r.exit_code == 0:
- assert r.response['status'] == 503
+ assert r.response['status'] == 502
# produce an error, fail to generate an error bucket
def test_h2_600_32(self, env, repeat):
- pytest.skip("needs fix in core protocol handling")
+ if env.httpd_is_at_least('2.5.0'):
+ pytest.skip("needs fix in core protocol handling")
conf = H2Conf(env)
conf.add_vhost_cgi(h2proxy_self=True)
conf.install()
"data-1k", "data-10k", "data-100k", "data-1m",
])
def test_h2_601_03_echo_fail_early(self, env, name):
+ if not env.httpd_is_at_least('2.4.58'):
+ pytest.skip(f'needs httpd 2.4.58')
fpath = os.path.join(env.gen_dir, name)
url = env.mkurl("https", "cgi", "/h2proxy/h2test/echo?fail_after=512")
r = env.curl_upload(url, fpath, options=[])
"data-1k", "data-10k", "data-100k", "data-1m",
])
def test_h2_601_04_echo_fail_late(self, env, name):
+ if not env.httpd_is_at_least('2.4.58'):
+ pytest.skip(f'needs httpd 2.4.58')
fpath = os.path.join(env.gen_dir, name)
url = env.mkurl("https", "cgi", f"/h2proxy/h2test/echo?fail_after={os.path.getsize(fpath)}")
r = env.curl_upload(url, fpath, options=[])
assert r.exit_code == 92 or r.response["status"] == 502
def test_h2_601_05_echo_fail_many(self, env):
+ if not env.httpd_is_at_least('2.4.58'):
+ pytest.skip(f'needs httpd 2.4.58')
if not env.curl_is_at_least('8.0.0'):
pytest.skip(f'need at least curl v8.0.0 for this')
count = 200