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

Method test_md_920_010

test/modules/md/test_920_status.py:111–165  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

109
110 # get the status of a domain on base server
111 def test_md_920_010(self, env):
112 domain = self.test_domain
113 domains = [domain]
114 conf = MDConf(env, std_vhosts=False, std_ports=False, text=f"""
115MDBaseServer on
116MDPortMap http:- https:{env.https_port}
117MDStapling on
118
119ServerName {domain}
120<IfModule ssl_module>
121SSLEngine on
122</IfModule>
123<IfModule tls_module>
124TLSListen {env.https_port}
125TLSStrictSNI off
126</IfModule>
127Protocols h2 http/1.1 acme-tls/1
128
129<Location "/server-status">
130 SetHandler server-status
131</Location>
132<Location "/md-status">
133 SetHandler md-status
134</Location>
135<VirtualHost *:{env.http_port}>
136 SSLEngine off
137</VirtualHost>
138 """)
139 conf.add_md(domains)
140 conf.install()
141 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
142 assert env.await_completion([domain], restart=False,
143 via_domain=env.http_addr, use_https=False)
144 status = env.get_md_status("", via_domain=env.http_addr, use_https=False)
145 assert "version" in status
146 assert "managed-domains" in status
147 assert 1 == len(status["managed-domains"])
148 # get the html page
149 status = env.get_server_status(via_domain=env.http_addr, use_https=False)
150 assert re.search(r'<h3>Managed Certificates</h3>', status, re.MULTILINE)
151 # get the ascii summary
152 status = env.get_server_status(query="?auto", via_domain=env.http_addr, use_https=False)
153 m = re.search(r'ManagedCertificatesTotal: (\d+)', status, re.MULTILINE)
154 assert m, status
155 assert int(m.group(1)) == 1
156 m = re.search(r'ManagedCertificatesOK: (\d+)', status, re.MULTILINE)
157 assert int(m.group(1)) == 0
158 m = re.search(r'ManagedCertificatesRenew: (\d+)', status, re.MULTILINE)
159 assert int(m.group(1)) == 1
160 m = re.search(r'ManagedCertificatesErrored: (\d+)', status, re.MULTILINE)
161 assert int(m.group(1)) == 0
162 m = re.search(r'ManagedCertificatesReady: (\d+)', status, re.MULTILINE)
163 assert int(m.group(1)) == 1
164 m = re.search(r'ManagedDomain\[0]Stapling: (on)', status, re.MULTILINE)
165 assert m, f'{status}'
166
167 def test_md_920_011(self, env):
168 # MD with static cert files in base server, see issue #161

Callers

nothing calls this directly

Calls 7

add_mdMethod · 0.95
MDConfClass · 0.85
installMethod · 0.80
apache_restartMethod · 0.80
await_completionMethod · 0.80
get_md_statusMethod · 0.80
get_server_statusMethod · 0.45

Tested by

no test coverage detected