diff --git a/test/modules/http2/conftest.py b/test/modules/http2/conftest.py index c6f8ddee..118cef1a 100644 --- a/test/modules/http2/conftest.py +++ b/test/modules/http2/conftest.py @@ -35,3 +35,5 @@ def _h2_package_scope(env): 'AH10400', # warning that 'enablereuse' has not effect in certain configs 'AH00045', # child did not exit in time, SIGTERM was sent ]) + yield + assert env.apache_stop() == 0 diff --git a/test/modules/http2/env.py b/test/modules/http2/env.py index bac1a841..b2443e00 100644 --- a/test/modules/http2/env.py +++ b/test/modules/http2/env.py @@ -2,6 +2,7 @@ import logging import os import subprocess +from shutil import copyfile from typing import Dict, Any from pyhttpd.certs import CertificateSpec @@ -52,6 +53,12 @@ def _setup_data_1k_1m(self): with open(os.path.join(self.env.gen_dir, "data-1m"), 'w') as f: for i in range(10000): f.write(f"{i:09d}-{s90}") + test1_docs = os.path.join(self.env.server_docs_dir, 'test1') + self.env.mkpath(test1_docs) + for fname in ["data-1k", "data-10k", "data-100k", "data-1m"]: + src = os.path.join(self.env.gen_dir, fname) + dest = os.path.join(test1_docs, fname) + copyfile(src, dest) class H2TestEnv(HttpdTestEnv): diff --git a/test/modules/http2/test_700_load_get.py b/test/modules/http2/test_700_load_get.py index 78760fbf..f9759932 100644 --- a/test/modules/http2/test_700_load_get.py +++ b/test/modules/http2/test_700_load_get.py @@ -61,3 +61,36 @@ def test_h2_700_11(self, env, conns): args.append(env.mkurl("https", "cgi", ("/mnot164.py?count=%d&text=%s" % (start+(n*chunk)+i, text)))) r = env.run(args) self.check_h2load_ok(env, r, chunk) + + # test window sizes, connection and stream + @pytest.mark.parametrize("connbits,streambits", [ + [10, 16], # 1k connection window, 64k stream windows + [10, 30], # 1k connection window, huge stream windows + [30, 8], # huge conn window, 256 bytes stream windows + ]) + def test_h2_700_20(self, env, connbits, streambits): + if not env.httpd_is_at_least("2.5.0"): + pytest.skip(f'need at least httpd 2.5.0 for this') + conf = H2Conf(env, extras={ + 'base': [ + 'StartServers 1', + ] + }) + conf.add_vhost_cgi().add_vhost_test1().install() + assert env.apache_restart() == 0 + assert env.is_live() + n = 2000 + conns = 50 + parallel = 10 + args = [ + env.h2load, + '-n', f'{n}', '-t', '1', + '-c', f'{conns}', '-m', f'{parallel}', + '-W', f'{connbits}', # connection window bits + '-w', f'{streambits}', # stream window bits + f'--connect-to=localhost:{env.https_port}', + f'--base-uri={env.mkurl("https", "test1", "/")}', + "/data-100k" + ] + r = env.run(args) + self.check_h2load_ok(env, r, n) \ No newline at end of file