def test_7021(self): domain = ("%s-" % self.test_n) + TestAuto.dns_uniq # generate config with two MDs dnsList = [domain, "www." + domain] conf = HttpdConf(TestAuto.TMP_CONF) conf.add_admin("*****@*****.**") conf._add_line("MDNotifyCmd %s/notify.py" % TestEnv.TESTROOT) conf.add_drive_mode("auto") conf.add_md(dnsList) conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=[dnsList[1]], withSSL=True) conf.install() # restart, check that md is in store assert TestEnv.apache_restart() == 0 self._check_md_names(domain, dnsList) # await drive completion assert TestEnv.await_completion([domain], 30) self._check_md_cert(dnsList) # this command should have failed and logged an error TestEnv.apachectl_stderr = None assert (0, 0) == TestEnv.apache_err_total()
def test_9001(self): domain = ("%s-" % self.test_n) + TestAuto.dns_uniq # generate config with two MDs dnsList = [ domain, "www." + domain ] conf = HttpdConf( TestAuto.TMP_CONF ) conf.add_admin( "*****@*****.**" ) conf.add_notify_cmd( "blablabla" ) conf.add_drive_mode( "auto" ) conf.add_md( dnsList ) conf.add_vhost( TestEnv.HTTPS_PORT, domain, aliasList=[ dnsList[1] ], withSSL=True ) conf.install() # restart, and retrieve cert assert TestEnv.apache_restart() == 0 assert TestEnv.await_completion( [ domain ] ) # this command should have failed and logged an error assert (1, 0) == TestEnv.apache_err_total()
def test_9010(self): domain = ("%s-" % self.test_n) + TestAuto.dns_uniq ncmd = ("%s/notify.py" % TestEnv.TESTROOT) nlog = ("%s/notify.log" % TestEnv.GEN_DIR) # generate config with two MDs dnsList = [ domain, "www." + domain ] conf = HttpdConf( TestAuto.TMP_CONF ) conf.add_admin( "*****@*****.**" ) conf.add_notify_cmd( "%s %s" % (ncmd, nlog) ) conf.add_drive_mode( "auto" ) conf.add_md( dnsList ) conf.add_vhost( TestEnv.HTTPS_PORT, domain, aliasList=[ dnsList[1] ], withSSL=True ) conf.install() # restart, and retrieve cert assert TestEnv.apache_restart() == 0 assert TestEnv.await_completion( [ domain ] ) # this command should have failed and logged an error assert (0, 0) == TestEnv.apache_err_total() nlines = open(nlog).readlines() assert 1 == len(nlines) assert ("['%s', '%s', '%s']" % (ncmd, nlog, domain)) == nlines[0]