@pytest.mark.skipif(condition=not MDTestEnv.has_a2md(), reason="no a2md available")
@pytest.mark.skipif(condition=not MDTestEnv.has_acme_server(),
reason="no ACME test server configured") class TestRegUpdate:
NAME1 = "greenbytes2.de"
NAME2 = "test-100.com"
@pytest.fixture(autouse=True, scope='function') def _method_scope(self, env):
env.clear_store() # add managed domains
domains = [
[self.NAME1, "www.greenbytes2.de", "mail.greenbytes2.de"],
[self.NAME2, "test-101.com", "test-102.com"]
] for dns in domains:
env.a2md(["-a", env.acme_url, "add"] + dns)
# test case: remove all domains def test_md_110_001(self, env): assert env.a2md(["update", self.NAME1, "domains"]).exit_code == 1
# test case: update domains with invalid DNS
@pytest.mark.parametrize("invalid_dns", [ "tld", "white sp.ace", "invalid.*.wildcard.com", "k\xc3ller.idn.com"
]) def test_md_110_002(self, env, invalid_dns): assert env.a2md(["update", self.NAME1, "domains", invalid_dns]).exit_code == 1
# test case: update domains with overlapping DNS list def test_md_110_003(self, env):
dns = [self.NAME1, self.NAME2] assert env.a2md(["update", self.NAME1, "domains"] + dns).exit_code == 1
# test case: update with subdomains def test_md_110_004(self, env):
dns = ["test-foo.com", "sub.test-foo.com"]
md = env.a2md(["update", self.NAME1, "domains"] + dns).json['output'][0] assert md['name'] == self.NAME1 assert md['domains'] == dns
# test case: update domains with duplicates def test_md_110_005(self, env):
dns = [self.NAME1, self.NAME1, self.NAME1]
md = env.a2md(["update", self.NAME1, "domains"] + dns).json['output'][0] assert md['name'] == self.NAME1 assert md['domains'] == [self.NAME1]
# test case: remove domains with punycode def test_md_110_006(self, env):
dns = [self.NAME1, "xn--kller-jua.punycode.de"]
md = env.a2md(["update", self.NAME1, "domains"] + dns).json['output'][0] assert md['name'] == self.NAME1 assert md['domains'] == dns
# test case: use invalid mail address
@pytest.mark.parametrize("invalid_mail", [ "no.at.char", "with blank@test.com", "missing.host@", "@missing.localpart.de", "double..dot@test.com", "double@at@test.com"
]) def test_md_110_304(self, env, invalid_mail): # SEI: Uhm, es ist nicht sinnvoll, eine komplette verification von # https://tools.ietf.org/html/rfc822 zu bauen? assert env.a2md(["update", self.NAME1, "contacts", invalid_mail]).exit_code == 1
# test case: respect urls as given
@pytest.mark.parametrize("url", [ "mailto:test@greenbytes.de", "wrong://schema@test.com"]) def test_md_110_305(self, env, url):
md = env.a2md(["update", self.NAME1, "contacts", url]).json['output'][0] assert md['contacts'] == [url] assert md['state'] == 1
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.