MCPcopy Create free account
hub / github.com/apache/httpd / test_md_702_005

Method test_md_702_005

test/modules/md/test_702_auto.py:184–212  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 15

add_drive_modeMethod · 0.95
add_mdMethod · 0.95
_write_res_fileMethod · 0.95
get_cnMethod · 0.95
MDConfClass · 0.85
MDCertUtilClass · 0.85
add_vhostMethod · 0.80
installMethod · 0.80
joinMethod · 0.80
apache_restartMethod · 0.80
check_mdMethod · 0.80
get_certMethod · 0.80

Tested by

no test coverage detected