Пример #1
0
    def test_710_003(self):
        domain = "a-" + self.test_domain
        domainb = "b-" + self.test_domain

        # use ACMEv1 initially
        TestEnv.set_acme('acmev1')
        ca_url = TestEnv.ACME_URL

        dnsList = [domain, "www." + domain]
        conf = HttpdConf()
        conf.clear()
        conf.add_admin("*****@*****.**")
        conf.add_line("MDCertificateAgreement accepted")
        conf.add_line("MDMembers auto")
        conf.start_md([domain])
        conf.add_line("MDCertificateAuthority %s" % (ca_url))
        conf.end_md()
        conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=dnsList[1:])
        conf.install()
        assert TestEnv.apache_restart() == 0
        TestEnv.check_md(domain, dnsList)
        assert TestEnv.await_completion([domain])
        assert (0, 0) == TestEnv.apache_err_count()
        TestEnv.check_md(domain, dnsList, ca=ca_url)

        # use ACMEv2 now, same MD, no CA url
        TestEnv.set_acme('acmev2')
        # this changes the default CA url
        assert TestEnv.ACME_URL_DEFAULT != ca_url

        conf = HttpdConf()
        conf.clear()
        conf.add_admin("*****@*****.**")
        conf.add_line("MDCertificateAgreement accepted")
        conf.add_line("MDMembers auto")
        conf.start_md([domain])
        conf.end_md()
        conf.start_md([domainb])
        # this willg get the reald Let's Encrypt URL assigned, turn off
        # auto renewal, so we will not talk to them
        conf.add_line("MDDriveMode manual")
        conf.end_md()
        conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=dnsList[1:])
        conf.add_vhost(TestEnv.HTTPS_PORT, domainb, aliasList=[])
        conf.install()

        assert TestEnv.apache_restart() == 0
        assert (0, 0) == TestEnv.apache_err_count()
        # the existing MD was migrated to new CA url
        TestEnv.check_md(domain, dnsList, ca=TestEnv.ACME_URL_DEFAULT)
        # the new MD got the new default anyway
        TestEnv.check_md(domainb, [domainb], ca=TestEnv.ACME_URL_DEFAULT)
Пример #2
0
 def test_300_011b(self):
     # MDomain, misses one ServerAlias, but auto add enabled
     TestEnv.install_test_conf("test_001");
     assert TestEnv.apache_stop() == 0
     TestEnv.install_test_conf("test_011b");
     assert TestEnv.apache_restart() == 0
     assert (0, 0) == TestEnv.apache_err_count()
Пример #3
0
 def test_300_021(self, confFile, expErrMsg):
     TestEnv.install_test_conf(confFile)
     assert TestEnv.apache_fail() == 0, "Server did start for {}".format(
         confFile)
     assert (1, 0) == TestEnv.apache_err_count()
     if expErrMsg:
         assert TestEnv.apache_err_scan(re.compile(expErrMsg))
Пример #4
0
 def test_300_010(self):
     # MDomain, vhost with matching ServerAlias
     TestEnv.install_test_conf("test_010");
     assert TestEnv.apache_restart() == 0
     assert (0, 0) == TestEnv.apache_err_count()
Пример #5
0
 def new_warnings(self):
     time.sleep(.1)
     (errors, warnings) = TestEnv.apache_err_count()
     return warnings
Пример #6
0
 def test_300_015(self):
     # valid pkey specification
     TestEnv.install_test_conf("test_015");
     assert TestEnv.apache_restart() == 0
     assert (0, 0) == TestEnv.apache_err_count()
Пример #7
0
 def test_300_014(self):
     # global server name as managed domain name
     TestEnv.install_test_conf("test_014");
     assert TestEnv.apache_restart() == 0
     assert (0, 0) == TestEnv.apache_err_count()
Пример #8
0
 def test_300_013(self):
     # one md covers two vhosts
     TestEnv.install_test_conf("test_013");
     assert TestEnv.apache_restart() == 0
     assert (0, 0) == TestEnv.apache_err_count()
Пример #9
0
 def test_300_012(self):
     # MDomain does not match any vhost
     TestEnv.install_test_conf("test_012");
     assert TestEnv.apache_restart() == 0
     assert (0, 1) == TestEnv.apache_err_count()
Пример #10
0
 def test_300_011(self):
     # MDomain, misses one ServerAlias
     TestEnv.install_test_conf("test_011");
     assert TestEnv.apache_fail() == 0
     assert (1, 0) == TestEnv.apache_err_count()