(self, env)
| 27 | self.test_domain = env.get_request_domain(request) |
| 28 | |
| 29 | def test_md_730_001(self, env): |
| 30 | # MD with static cert files, will not be driven |
| 31 | domain = self.test_domain |
| 32 | domains = [domain, 'www.%s' % domain] |
| 33 | testpath = os.path.join(env.gen_dir, 'test_730_001') |
| 34 | env.mkpath(testpath) |
| 35 | # cert that is only 10 more days valid |
| 36 | creds = env.create_self_signed_cert(CertificateSpec(domains=domains), |
| 37 | valid_from=timedelta(days=-80), |
| 38 | valid_to=timedelta(days=10), |
| 39 | serial=730001) |
| 40 | cert_file = os.path.join(testpath, 'pubcert.pem') |
| 41 | pkey_file = os.path.join(testpath, 'privkey.pem') |
| 42 | creds.save_cert_pem(cert_file) |
| 43 | creds.save_pkey_pem(pkey_file) |
| 44 | conf = MDConf(env) |
| 45 | conf.start_md(domains) |
| 46 | conf.add(f"MDCertificateFile {cert_file}") |
| 47 | conf.add(f"MDCertificateKeyFile {pkey_file}") |
| 48 | conf.end_md() |
| 49 | conf.add_vhost(domain) |
| 50 | conf.install() |
| 51 | assert env.apache_restart() == 0, f'{env.apachectl_stderr}' |
| 52 | |
| 53 | # check if the domain uses it, it appears in our stats and renewal is off |
| 54 | cert = env.get_cert(domain) |
| 55 | assert cert.same_serial_as(730001) |
| 56 | stat = env.get_md_status(domain) |
| 57 | assert stat |
| 58 | assert 'cert' in stat |
| 59 | assert stat['renew'] is True |
| 60 | assert 'renewal' not in stat |
| 61 | env.httpd_error_log.ignore_recent( |
| 62 | matches = [ |
| 63 | r'.*cert has no authority key id extension.*' |
| 64 | ] |
| 65 | ) |
| 66 | |
| 67 | def test_md_730_002(self, env): |
| 68 | # MD with static cert files, force driving |
nothing calls this directly
no test coverage detected