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

Method test_md_730_003

test/modules/md/test_730_static.py:108–144  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

106 )
107
108 def test_md_730_003(self, env):
109 # just configuring one file will not work
110 domain = self.test_domain
111 domains = [domain, 'www.%s' % domain]
112 testpath = os.path.join(env.gen_dir, 'test_730_003')
113 env.mkpath(testpath)
114 # cert that is only 10 more days valid
115 creds = env.create_self_signed_cert(CertificateSpec(domains=domains),
116 valid_from=timedelta(days=-80),
117 valid_to=timedelta(days=10),
118 serial=730001)
119 cert_file = os.path.join(testpath, 'pubcert.pem')
120 pkey_file = os.path.join(testpath, 'privkey.pem')
121 creds.save_cert_pem(cert_file)
122 creds.save_pkey_pem(pkey_file)
123 conf = MDConf(env)
124 conf.start_md(domains)
125 conf.add(f"MDCertificateFile {cert_file}")
126 conf.end_md()
127 conf.add_vhost(domain)
128 conf.install()
129 assert env.apache_fail() == 0
130
131 conf = MDConf(env)
132 conf.start_md(domains)
133 conf.add(f"MDCertificateKeyFile {pkey_file}")
134 conf.end_md()
135 conf.add_vhost(domain)
136 conf.install()
137 assert env.apache_fail() == 0
138 #
139 env.httpd_error_log.ignore_recent(
140 lognos = [
141 "AH10170", # Managed Domain needs one MDCertificateKeyFile for each MDCertificateFile
142 "AH10171" # Managed Domain has MDCertificateKeyFile(s) but no MDCertificateFile
143 ]
144 )

Callers

nothing calls this directly

Calls 14

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