(self, env)
| 182 | |
| 183 | # test case: drive_mode manual, check that server starts, but requests to domain are 503'd |
| 184 | def test_md_702_005(self, env): |
| 185 | domain = self.test_domain |
| 186 | name_a = "test-a." + domain |
| 187 | domains = [domain, name_a] |
| 188 | # |
| 189 | # generate 1 MD and 1 vhost |
| 190 | conf = MDConf(env, admin="admin@" + domain) |
| 191 | conf.add_drive_mode("manual") |
| 192 | conf.add_md(domains) |
| 193 | conf.add_vhost(name_a, doc_root="htdocs/a") |
| 194 | conf.install() |
| 195 | # |
| 196 | # create docRoot folder |
| 197 | self._write_res_file(os.path.join(env.server_docs_dir, "a"), "name.txt", name_a) |
| 198 | # |
| 199 | # restart, check that md is in store |
| 200 | assert env.apache_restart() == 0, f'{env.apachectl_stderr}' |
| 201 | env.check_md(domains) |
| 202 | # |
| 203 | # check: that request to domains give 503 Service Unavailable |
| 204 | cert1 = env.get_cert(name_a) |
| 205 | assert name_a in cert1.get_san_list() |
| 206 | assert env.get_http_status(name_a, "/name.txt") == 503 |
| 207 | # |
| 208 | # check temporary cert from server |
| 209 | cert2 = MDCertUtil(env.path_fallback_cert(domain)) |
| 210 | assert cert1.same_serial_as(cert2), \ |
| 211 | "Unexpected temporary certificate on vhost %s. Expected cn: %s , "\ |
| 212 | "but found cn: %s" % (name_a, cert2.get_cn(), cert1.get_cn()) |
| 213 | |
| 214 | # test case: drive MD with only invalid challenges, domains should stay 503'd |
| 215 | def test_md_702_006(self, env): |
nothing calls this directly
no test coverage detected