(self, env)
| 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""" |
| 115 | MDBaseServer on |
| 116 | MDPortMap http:- https:{env.https_port} |
| 117 | MDStapling on |
| 118 | |
| 119 | ServerName {domain} |
| 120 | <IfModule ssl_module> |
| 121 | SSLEngine on |
| 122 | </IfModule> |
| 123 | <IfModule tls_module> |
| 124 | TLSListen {env.https_port} |
| 125 | TLSStrictSNI off |
| 126 | </IfModule> |
| 127 | Protocols 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 |
nothing calls this directly
no test coverage detected