diff options
-rw-r--r-- | test/modules/http2/test_004_post.py | 19 | ||||
-rw-r--r-- | test/modules/http2/test_500_proxy.py | 52 |
2 files changed, 37 insertions, 34 deletions
diff --git a/test/modules/http2/test_004_post.py b/test/modules/http2/test_004_post.py index 295f989b88..e7938f007b 100644 --- a/test/modules/http2/test_004_post.py +++ b/test/modules/http2/test_004_post.py @@ -18,14 +18,7 @@ class TestPost: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env): TestPost._local_dir = os.path.dirname(inspect.getfile(TestPost)) - 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 = H2Conf(env) conf.add_vhost_cgi(proxy_self=True).install() assert env.apache_restart() == 0 @@ -190,6 +183,16 @@ class TestPost: 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 diff --git a/test/modules/http2/test_500_proxy.py b/test/modules/http2/test_500_proxy.py index 309db63fc2..6ab8275b11 100644 --- a/test/modules/http2/test_500_proxy.py +++ b/test/modules/http2/test_500_proxy.py @@ -49,11 +49,11 @@ class TestProxy: src = file.read() assert r2.response["body"] == src - def test_h2_500_10(self, env, repeat): - self.curl_upload_and_verify(env, "data-1k", ["--http2"]) - self.curl_upload_and_verify(env, "data-10k", ["--http2"]) - self.curl_upload_and_verify(env, "data-100k", ["--http2"]) - self.curl_upload_and_verify(env, "data-1m", ["--http2"]) + @pytest.mark.parametrize("name", [ + "data-1k", "data-10k", "data-100k", "data-1m", + ]) + def test_h2_500_10(self, env, name, repeat): + self.curl_upload_and_verify(env, name, ["--http2"]) def test_h2_500_11(self, env): self.curl_upload_and_verify(env, "data-1k", [ @@ -77,17 +77,17 @@ class TestProxy: fd.write(r.stderr) assert r.response["body"] == src - def test_h2_500_20(self, env, repeat): - self.nghttp_post_and_verify(env, "data-1k", []) - self.nghttp_post_and_verify(env, "data-10k", []) - self.nghttp_post_and_verify(env, "data-100k", []) - self.nghttp_post_and_verify(env, "data-1m", []) + @pytest.mark.parametrize("name", [ + "data-1k", "data-10k", "data-100k", "data-1m", + ]) + def test_h2_500_20(self, env, name, repeat): + self.nghttp_post_and_verify(env, name, []) - def test_h2_500_21(self, env, repeat): - self.nghttp_post_and_verify(env, "data-1k", ["--no-content-length"]) - self.nghttp_post_and_verify(env, "data-10k", ["--no-content-length"]) - self.nghttp_post_and_verify(env, "data-100k", ["--no-content-length"]) - self.nghttp_post_and_verify(env, "data-1m", ["--no-content-length"]) + @pytest.mark.parametrize("name", [ + "data-1k", "data-10k", "data-100k", "data-1m", + ]) + def test_h2_500_21(self, env, name, repeat): + self.nghttp_post_and_verify(env, name, ["--no-content-length"]) # upload and GET again using nghttp, compare to original content def nghttp_upload_and_verify(self, env, fname, options=None): @@ -107,17 +107,17 @@ class TestProxy: src = file.read() assert src == r2.response["body"] - def test_h2_500_22(self, env): - self.nghttp_upload_and_verify(env, "data-1k", []) - self.nghttp_upload_and_verify(env, "data-10k", []) - self.nghttp_upload_and_verify(env, "data-100k", []) - self.nghttp_upload_and_verify(env, "data-1m", []) + @pytest.mark.parametrize("name", [ + "data-1k", "data-10k", "data-100k", "data-1m", + ]) + def test_h2_500_22(self, env, name): + self.nghttp_upload_and_verify(env, name, []) - def test_h2_500_23(self, env): - self.nghttp_upload_and_verify(env, "data-1k", ["--no-content-length"]) - self.nghttp_upload_and_verify(env, "data-10k", ["--no-content-length"]) - self.nghttp_upload_and_verify(env, "data-100k", ["--no-content-length"]) - self.nghttp_upload_and_verify(env, "data-1m", ["--no-content-length"]) + @pytest.mark.parametrize("name", [ + "data-1k", "data-10k", "data-100k", "data-1m", + ]) + def test_h2_500_23(self, env, name): + self.nghttp_upload_and_verify(env, name, ["--no-content-length"]) # upload using nghttp and check returned status def nghttp_upload_stat(self, env, fname, options=None): @@ -130,7 +130,7 @@ class TestProxy: assert r.response["header"]["location"] def test_h2_500_24(self, env): - for i in range(100): + for i in range(50): self.nghttp_upload_stat(env, "data-1k", ["--no-content-length"]) # lets do some error tests |