You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2022/03/25 13:25:51 UTC

svn commit: r1899197 - in /httpd/httpd/trunk/test/modules/tls: conftest.py test_16_proxy_mixed.py

Author: icing
Date: Fri Mar 25 13:25:51 2022
New Revision: 1899197

URL: http://svn.apache.org/viewvc?rev=1899197&view=rev
Log:
  *) test/modules/tls: make proxy tests repeatable.


Modified:
    httpd/httpd/trunk/test/modules/tls/conftest.py
    httpd/httpd/trunk/test/modules/tls/test_16_proxy_mixed.py

Modified: httpd/httpd/trunk/test/modules/tls/conftest.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/tls/conftest.py?rev=1899197&r1=1899196&r2=1899197&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/tls/conftest.py (original)
+++ httpd/httpd/trunk/test/modules/tls/conftest.py Fri Mar 25 13:25:51 2022
@@ -18,6 +18,19 @@ def pytest_report_header(config, startdi
     )
 
 
+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

Modified: httpd/httpd/trunk/test/modules/tls/test_16_proxy_mixed.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/tls/test_16_proxy_mixed.py?rev=1899197&r1=1899196&r2=1899197&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/tls/test_16_proxy_mixed.py (original)
+++ httpd/httpd/trunk/test/modules/tls/test_16_proxy_mixed.py Fri Mar 25 13:25:51 2022
@@ -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}