]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) test/modules/tls: make proxy tests repeatable.
authorStefan Eissing <icing@apache.org>
Fri, 25 Mar 2022 13:25:51 +0000 (13:25 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 25 Mar 2022 13:25:51 +0000 (13:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899197 13f79535-47bb-0310-9956-ffa450edef68

test/modules/tls/conftest.py
test/modules/tls/test_16_proxy_mixed.py

index cde4be607140e5d99f2af5506a2cfac5f52266a3..9580307dfdcc343eb8dbc369220957b72b96cc1a 100644 (file)
@@ -18,6 +18,19 @@ def pytest_report_header(config, startdir):
     )
 
 
+def pytest_addoption(parser):
+    parser.addoption("--repeat", action="store", type=int, default=1,
+                     help='Number of times to repeat each test')
+    parser.addoption("--all", action="store_true")
+
+
+def pytest_generate_tests(metafunc):
+    if "repeat" in metafunc.fixturenames:
+        count = int(metafunc.config.getoption("repeat"))
+        metafunc.fixturenames.append('tmp_ct')
+        metafunc.parametrize('repeat', range(count))
+
+
 @pytest.fixture(scope="package")
 def env(pytestconfig) -> TlsTestEnv:
     level = logging.INFO
index a37c530ba2f9d2476a0946574237992e72acf0b1..11b8efe0de56f9afdb8ef0ce47f0d2dcaf205b0e 100644 (file)
@@ -1,3 +1,5 @@
+import time
+
 import pytest
 
 from .conf import TlsTestConf
@@ -9,7 +11,7 @@ class TestProxyMixed:
     def _class_scope(self, env):
         conf = TlsTestConf(env=env, extras={
             'base': [
-                "LogLevel proxy:trace1 proxy_http:trace1 ssl:trace1 proxy_http2:trace1",
+                "LogLevel proxy:trace1 proxy_http:trace1 ssl:trace1 proxy_http2:trace1 http2:debug",
                 "ProxyPreserveHost on",
             ],
             env.domain_a: [
@@ -34,10 +36,12 @@ class TestProxyMixed:
         conf.install()
         assert env.apache_restart() == 0
 
-    def test_16_proxy_mixed_ssl_get(self, env):
+    def test_16_proxy_mixed_ssl_get(self, env, repeat):
         data = env.tls_get_json(env.domain_b, "/proxy-ssl/index.json")
         assert data == {'domain': env.domain_b}
 
-    def test_16_proxy_mixed_tls_get(self, env):
+    def test_16_proxy_mixed_tls_get(self, env, repeat):
         data = env.tls_get_json(env.domain_a, "/proxy-tls/index.json")
+        if data is None:
+            time.sleep(300)
         assert data == {'domain': env.domain_a}