Files
apache_httpd/test/modules/tls/test_11_md.py
Stefan Eissing 1c5f651841 * test suite: adding modules/tls, the test suite for the
new mod_tls module to be run via pytest.
    Integration into travis TBD.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895433 13f79535-47bb-0310-9956-ffa450edef68
2021-11-30 16:30:26 +00:00

38 lines
1.1 KiB
Python

import time
from datetime import timedelta
import pytest
from .conf import TlsTestConf
class TestMD:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
conf = TlsTestConf(env=env, extras={
'base': "LogLevel md:trace4"
})
conf.add_md_vhosts(domains=[env.domain_a, env.domain_b])
conf.install()
assert env.apache_restart() == 0
def test_11_get_a(self, env):
# do we see the correct json for the domain_a?
data = env.tls_get_json(env.domain_a, "/index.json")
assert data == {'domain': env.domain_a}
def test_11_get_b(self, env):
# do we see the correct json for the domain_a?
data = env.tls_get_json(env.domain_b, "/index.json")
assert data == {'domain': env.domain_b}
def test_11_get_base(self, env):
# give the base server domain_a and lookup its index.json
conf = TlsTestConf(env=env)
conf.add_md_base(domain=env.domain_a)
conf.install()
assert env.apache_restart() == 0
data = env.tls_get_json(env.domain_a, "/index.json")
assert data == {'domain': 'localhost'}