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([
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')
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')
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')
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')
import os
import pytest
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
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 = []
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')
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')
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:
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')
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')
import pytest
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
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')
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
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')
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')
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')
import os
import pytest
-from .env import H2Conf
+from .env import H2Conf, H2TestEnv
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')
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')
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')
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')
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')
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')
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')
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')
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:
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')
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')
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')
"logio",
"unixd",
"version",
+ "watchdog",
"authn_core",
"authz_host",
"authz_groupfile",