]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) test: check for the mpm module used and disable http2 tests
authorStefan Eissing <icing@apache.org>
Fri, 25 Feb 2022 13:17:11 +0000 (13:17 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 25 Feb 2022 13:17:11 +0000 (13:17 +0000)
     for prefork.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898417 13f79535-47bb-0310-9956-ffa450edef68

29 files changed:
test/modules/http2/env.py
test/modules/http2/test_001_httpd_alive.py
test/modules/http2/test_002_curl_basics.py
test/modules/http2/test_003_get.py
test/modules/http2/test_004_post.py
test/modules/http2/test_005_files.py
test/modules/http2/test_006_assets.py
test/modules/http2/test_100_conn_reuse.py
test/modules/http2/test_101_ssl_reneg.py
test/modules/http2/test_102_require.py
test/modules/http2/test_103_upgrade.py
test/modules/http2/test_104_padding.py
test/modules/http2/test_105_timeout.py
test/modules/http2/test_106_shutdown.py
test/modules/http2/test_200_header_invalid.py
test/modules/http2/test_201_header_conditional.py
test/modules/http2/test_202_trailer.py
test/modules/http2/test_300_interim.py
test/modules/http2/test_400_push.py
test/modules/http2/test_401_early_hints.py
test/modules/http2/test_500_proxy.py
test/modules/http2/test_501_proxy_serverheader.py
test/modules/http2/test_502_proxy_port.py
test/modules/http2/test_600_h2proxy.py
test/modules/http2/test_700_load_get.py
test/modules/http2/test_710_load_post_static.py
test/modules/http2/test_711_load_post_cgi.py
test/modules/http2/test_712_buffering.py
test/pyhttpd/env.py

index 8b2d54230c733e085a6603bfee82e293c78ba708..a65ac98caa8223083201fb4a7543485871b4f6fb 100644 (file)
@@ -57,6 +57,11 @@ class H2TestSetup(HttpdTestSetup):
 
 class H2TestEnv(HttpdTestEnv):
 
+    @classmethod
+    def is_unsupported(cls):
+        mpm_module = f"mpm_{os.environ['MPM']}" if 'MPM' in os.environ else 'mpm_event'
+        return mpm_module in ['mpm_prefork']
+
     def __init__(self, pytestconfig=None):
         super().__init__(pytestconfig=pytestconfig)
         self.add_httpd_conf([
index 557d17a453fc88dd3608deb5bf47f326160e1e3a..b5708d2813489f159f1d2e1f3783d84a627e3e5d 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestBasicAlive:
 
     @pytest.fixture(autouse=True, scope='class')
index bb03bd84f3dabc7bed809439e75650c06a371496..91be772114e0ce6d2f68ca2da39983c544220ab3 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestCurlBasics:
 
     @pytest.fixture(autouse=True, scope='class')
index ccef11fbdeb2bbe405ca7120a54a90cc95658362..f38c745b396dc828727240811c810b83bf420a4d 100644 (file)
@@ -1,9 +1,10 @@
 import re
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestGet:
 
     @pytest.fixture(autouse=True, scope='class')
index 1a52623a9a96d489e789a7d9d1093b8ad42d0859..b4f4e443d512d152975844109f40e877b203d0b8 100644 (file)
@@ -8,9 +8,10 @@ import sys
 
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestPost:
 
     @pytest.fixture(autouse=True, scope='class')
index 3f0a63ac1108554ff762aa5b2ad5264dfe5c824d..e7618362c529885c922a9ec45a29b16d10ac4619 100644 (file)
@@ -1,7 +1,7 @@
 import os
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
 def mk_text_file(fpath: str, lines: int):
@@ -15,6 +15,7 @@ def mk_text_file(fpath: str, lines: int):
             fd.write("\n")
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestFiles:
 
     URI_PATHS = []
index 7a0222e0ac2c6f2cebbf1e8dc42c56baa3f81d10..778314eda023729600e73193fee42d5f6c829b86 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestAssets:
 
     @pytest.fixture(autouse=True, scope='class')
index 7df7a605cc3412983c501bf96b42747db9ecb2f6..e0b663190a33604643a2fa3003ad7304986fde66 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestConnReuse:
 
     @pytest.fixture(autouse=True, scope='class')
index 1ca23d4a5d4de9eccbe9660a2526581e0218c146..66f2638a7b5afa374b22150dd38f318358632fc3 100644 (file)
@@ -4,6 +4,7 @@ import pytest
 from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 @pytest.mark.skipif(H2TestEnv.get_ssl_module() != "mod_ssl", reason="only for mod_ssl")
 class TestSslRenegotiation:
 
index ed83a981a25ee0ffa673fc39d993cc6e42af5d57..b7e4eaef6ede7c4e1575aecc6f9f8062285d6916 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestRequire:
 
     @pytest.fixture(autouse=True, scope='class')
index 92f9e3649812ec966b7f5b524abce76cd54b2587..2fa7d1d68a2e2ee59484d01a925104a7cddeb79b 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestUpgrade:
 
     @pytest.fixture(autouse=True, scope='class')
index 60915fab3e8eaf652d9a602f57c59f723badc7b7..7b874ed9ce32cc6c3d15396f120e941b79bff6fe 100644 (file)
@@ -1,6 +1,6 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
 def frame_padding(payload, padbits):
@@ -8,6 +8,7 @@ def frame_padding(payload, padbits):
     return ((payload + 9 + mask) & ~mask) - (payload + 9)
         
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestPadding:
 
     @pytest.fixture(autouse=True, scope='class')
index 24133ae52cfdeef3196649e98b6338ff47df8fbd..d8dada90c42f13dba2bf54df377f89c6ec7afb07 100644 (file)
@@ -3,10 +3,11 @@ import time
 
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 from pyhttpd.curl import CurlPiper
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestTimeout:
 
     # Check that base servers 'Timeout' setting is observed on SSL handshake
index 21036ed28e940c9bea7dbb436203ca0471169064..b119292b72d0f0325fecc8a4e5f2db9ba3cacdba 100644 (file)
@@ -7,10 +7,11 @@ from threading import Thread
 
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 from pyhttpd.result import ExecResult
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestShutdown:
 
     @pytest.fixture(autouse=True, scope='class')
index c1ac2dea32633647cadb1f62eaf6eee55cfc47fa..b09a5a6ecb341903b9ec4a5edfbbf73594fe66df 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestInvalidHeaders:
 
     @pytest.fixture(autouse=True, scope='class')
index be52400a2bbd9efbc504dc33bfd5da9e70ac03ef..f1032683bf4ee85f497b9e4b4f10f01ea782a6ae 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestConditionalHeaders:
 
     @pytest.fixture(autouse=True, scope='class')
index ae3d8970b3f4482bfaeda5304d1d7d5b54fa63fc..fce46c1574f6df484c5a26a551d4facf7a08bcb2 100644 (file)
@@ -1,7 +1,7 @@
 import os
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
 def setup_data(env):
@@ -13,6 +13,7 @@ def setup_data(env):
 
 # The trailer tests depend on "nghttp" as no other client seems to be able to send those
 # rare things.
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestTrailers:
 
     @pytest.fixture(autouse=True, scope='class')
index 0ca674a015989def56d1b5c73c3b3c0c9848fd1b..774ab88a061eeaacc7e664b3097b9c4e2fee7cf8 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestInterimResponses:
 
     @pytest.fixture(autouse=True, scope='class')
index 1d7410031da635709e8caa574c931884f256d2b4..9c61608d87136bd1b92be6fa4283caa53eb148b8 100644 (file)
@@ -1,10 +1,11 @@
 import os
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
 # The push tests depend on "nghttp"
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestPush:
 
     @pytest.fixture(autouse=True, scope='class')
index fb099e5d60d474e4172bb0cce69c60e698c6b042..1b851d308036e7c5e9a1e332d2ecd1134349a783 100644 (file)
@@ -1,9 +1,10 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
 # The push tests depend on "nghttp"
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestEarlyHints:
 
     @pytest.fixture(autouse=True, scope='class')
index 7240c39b272d75d4bb40a24c0893dc3241150854..5eec0522635e4e77273ffb686cc2c00bd0f698f4 100644 (file)
@@ -3,9 +3,10 @@ import os
 import re
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestProxy:
 
     @pytest.fixture(autouse=True, scope='class')
index d78db1a6d84b50bb668ab7ac0dd317f5035153c3..0d7c18890056585f68802de592f919e4dfb220e1 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestProxyServerHeader:
 
     @pytest.fixture(autouse=True, scope='class')
index 472f625ad5f65bf69f93941bd03c0662b65c1c74..f6c6db156fb39bfe4ec97a332f9f2675a623b921 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestProxyPort:
 
     @pytest.fixture(autouse=True, scope='class')
index 1c0b7e96fb7a6cf346e7762efcdba0703ec7e826..d27143d22c42a1f339db63eecaa26e35939391ad 100644 (file)
@@ -1,8 +1,9 @@
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestH2Proxy:
 
     @pytest.fixture(autouse=True, scope='class')
index 77b85f2fc81456863de39fed7815ed6aac428312..d1121a6065c0bea86b96397e3a8d560c1d6fb77a 100644 (file)
@@ -3,6 +3,7 @@ import pytest
 from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 @pytest.mark.skipif(not H2TestEnv().h2load_is_at_least('1.41.0'),
                     reason="h2load misses --connect-to option")
 class TestLoadGet:
index 5e3ac1c8822cb55127c36608210fd17f917981b6..9a0e1e250b6c16984e3457fad9b4a4c7c9666eda 100644 (file)
@@ -1,9 +1,10 @@
 import pytest
 import os
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestLoadPostStatic:
 
     @pytest.fixture(autouse=True, scope='class')
index dca9ce5f21d2bc0948503d5077ec93d04b0bac60..81bc8e10bcf2331d1fc744809bd480b804154f6a 100644 (file)
@@ -1,9 +1,10 @@
 import pytest
 import os
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestLoadCgi:
 
     @pytest.fixture(autouse=True, scope='class')
index 219314816c2cfa1fb9c8f011d9843e9efba6c3b4..9eb26890ad71d3f43652f241fbf431a2d2b9d90c 100644 (file)
@@ -2,10 +2,11 @@ from datetime import timedelta
 
 import pytest
 
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
 from pyhttpd.curl import CurlPiper
 
 
+@pytest.mark.skipif(condition=H2TestEnv.is_unsupported, reason="mod_http2 not supported here")
 class TestBuffering:
 
     @pytest.fixture(autouse=True, scope='class')
index 35eb092fd52b7db616419dafff261c002b2d1755..89d04dd95ee43886785a9e4fbfe4100a4b4ad5bb 100644 (file)
@@ -35,6 +35,7 @@ class HttpdTestSetup:
         "logio",
         "unixd",
         "version",
+        "watchdog",
         "authn_core",
         "authz_host",
         "authz_groupfile",