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

Method test_md_901_040

test/modules/md/test_901_message.py:301–333  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

299
300 # MD, check a failed challenge setup
301 def test_md_901_040(self, env):
302 domain = self.test_domain
303 domains = [domain]
304 conf = MDConf(env)
305 mcmd = os.path.join(env.test_dir, "../modules/md/msg_fail_on.py")
306 conf.add(f"MDMessageCmd {mcmd} {self.mlog} challenge-setup")
307 conf.add_drive_mode("auto")
308 conf.add_md(domains)
309 conf.add_vhost(domains)
310 conf.install()
311 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
312 assert env.await_error(domain)
313 assert env.await_file(self.mlog)
314 time.sleep(1)
315 nlines = open(self.mlog).readlines()
316 assert len(nlines) == 2
317 assert nlines[0].strip() == \
318 f"['{mcmd}', '{self.mlog}', 'challenge-setup:http-01:{domain}', '{domain}']"
319 assert nlines[1].strip() == \
320 f"['{mcmd}', '{self.mlog}', 'errored', '{domain}']"
321 stat = env.get_md_status(domain)
322 # this command should have failed and logged an error
323 assert stat["renewal"]["last"]["problem"] == "challenge-setup-failure"
324 #
325 env.httpd_error_log.ignore_recent(
326 lognos = [
327 "AH10056" # None of the offered challenge types
328 ],
329 matches = [
330 r'.*urn:org:apache:httpd:log:AH10109:.*',
331 r'.*problem\[challenge-setup-failure\].*'
332 ]
333 )

Callers

nothing calls this directly

Calls 12

add_drive_modeMethod · 0.95
add_mdMethod · 0.95
MDConfClass · 0.85
joinMethod · 0.80
addMethod · 0.80
add_vhostMethod · 0.80
installMethod · 0.80
apache_restartMethod · 0.80
await_errorMethod · 0.80
await_fileMethod · 0.80
get_md_statusMethod · 0.80
ignore_recentMethod · 0.80

Tested by

no test coverage detected