(self, env)
| 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 | ) |
nothing calls this directly
no test coverage detected