mirror of
https://github.com/apache/httpd.git
synced 2026-10-23 22:49:01 +03:00
Submitted by Maya Echtinaw This closes #808 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939059 13f79535-47bb-0310-9956-ffa450edef68
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
import logging
|
|
import os
|
|
|
|
import pytest
|
|
import sys
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
|
|
|
|
from .env import H2TestEnv
|
|
|
|
|
|
def pytest_report_header(config, start_path):
|
|
env = H2TestEnv()
|
|
return f"mod_h2 [apache: {env.get_httpd_version()}, mpm: {env.mpm_module}, {env.prefix}]"
|
|
|
|
|
|
@pytest.fixture(scope="package")
|
|
def env(pytestconfig) -> H2TestEnv:
|
|
level = logging.INFO
|
|
console = logging.StreamHandler()
|
|
console.setLevel(level)
|
|
console.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
|
|
logging.getLogger('').addHandler(console)
|
|
logging.getLogger('').setLevel(level=level)
|
|
env = H2TestEnv(pytestconfig=pytestconfig)
|
|
# the h2 vhosts are TLS, so setup_httpd() hard-requires mod_ssl and
|
|
# raises if it was not built. Report that as the missing dependency.
|
|
env.require(env.has_mod_ssl(), "no mod_ssl available", dep="mod_ssl",
|
|
detected=f"no mod_ssl.so in {env.libexec_dir}")
|
|
env.setup_httpd()
|
|
env.apache_access_log_clear()
|
|
env.httpd_error_log.clear_log()
|
|
return env
|
|
|
|
|
|
@pytest.fixture(autouse=True, scope="package")
|
|
def _h2_package_scope(env):
|
|
env.httpd_error_log.add_ignored_lognos([
|
|
'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
|