(self, env)
| 179 | assert not os.path.isfile(self.mlog) |
| 180 | |
| 181 | def test_md_901_011(self, env): |
| 182 | # MD with static cert files, lifetime in warn window, check message |
| 183 | domain = self.test_domain |
| 184 | domains = [domain, f'www.{domain}'] |
| 185 | testpath = os.path.join(env.gen_dir, 'test_901_011') |
| 186 | env.mkpath(testpath) |
| 187 | # cert that is only 5 more days valid |
| 188 | creds = env.create_self_signed_cert(CertificateSpec(domains=domains), |
| 189 | valid_from=timedelta(days=-85), |
| 190 | valid_to=timedelta(days=5), |
| 191 | serial=901010) |
| 192 | cert_file = os.path.join(testpath, 'pubcert.pem') |
| 193 | pkey_file = os.path.join(testpath, 'privkey.pem') |
| 194 | creds.save_cert_pem(cert_file) |
| 195 | creds.save_pkey_pem(pkey_file) |
| 196 | conf = MDConf(env) |
| 197 | conf.add(f"MDMessageCmd {self.mcmd} {self.mlog}") |
| 198 | conf.start_md(domains) |
| 199 | conf.add(f"MDCertificateFile {cert_file}") |
| 200 | conf.add(f"MDCertificateKeyFile {pkey_file}") |
| 201 | conf.end_md() |
| 202 | conf.add_vhost(domain) |
| 203 | conf.install() |
| 204 | assert env.apache_restart() == 0, f'{env.apachectl_stderr}' |
| 205 | assert env.await_file(self.mlog) |
| 206 | nlines = open(self.mlog).readlines() |
| 207 | assert len(nlines) == 1 |
| 208 | assert nlines[0].strip() == f"['{self.mcmd}', '{self.mlog}', 'expiring', '{domain}']" |
| 209 | # check that we do not get it resend right away again |
| 210 | assert env.apache_restart() == 0, f'{env.apachectl_stderr}' |
| 211 | time.sleep(1) |
| 212 | nlines = open(self.mlog).readlines() |
| 213 | assert len(nlines) == 1 |
| 214 | assert nlines[0].strip() == f"['{self.mcmd}', '{self.mlog}', 'expiring', '{domain}']" |
| 215 | |
| 216 | # MD, check messages from stapling |
| 217 | @pytest.mark.skipif(MDTestEnv.lacks_ocsp(), reason="no OCSP responder") |
nothing calls this directly
no test coverage detected