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

Method test_md_901_010

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

Source from the content-addressed store, hash-verified

153 assert nlines[0].strip() == f"['{self.mcmd}', '{self.mlog}', 'renewed', '{domain}']"
154
155 def test_md_901_010(self, env):
156 # MD with static cert files, lifetime in renewal window, no message about renewal
157 domain = self.test_domain
158 domains = [domain, 'www.%s' % domain]
159 testpath = os.path.join(env.gen_dir, 'test_901_010')
160 env.mkpath(testpath)
161 # cert that is only 20 more days valid
162 creds = env.create_self_signed_cert(CertificateSpec(domains=domains),
163 valid_from=timedelta(days=-70),
164 valid_to=timedelta(days=20),
165 serial=901010)
166 cert_file = os.path.join(testpath, 'pubcert.pem')
167 pkey_file = os.path.join(testpath, 'privkey.pem')
168 creds.save_cert_pem(cert_file)
169 creds.save_pkey_pem(pkey_file)
170 conf = MDConf(env)
171 conf.add(f"MDMessageCmd {self.mcmd} {self.mlog}")
172 conf.start_md(domains)
173 conf.add(f"MDCertificateFile {cert_file}")
174 conf.add(f"MDCertificateKeyFile {pkey_file}")
175 conf.end_md()
176 conf.add_vhost(domain)
177 conf.install()
178 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
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

Callers

nothing calls this directly

Calls 13

start_mdMethod · 0.95
end_mdMethod · 0.95
CertificateSpecClass · 0.90
MDConfClass · 0.85
joinMethod · 0.80
mkpathMethod · 0.80
save_cert_pemMethod · 0.80
save_pkey_pemMethod · 0.80
addMethod · 0.80
add_vhostMethod · 0.80
installMethod · 0.80

Tested by

no test coverage detected