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

Method test_proxy_02_003

test/modules/proxy/test_02_unix.py:132–161  ·  view source on GitHub ↗
(self, env, via, exp_status)

Source from the content-addressed store, hash-verified

130 ["mixed", 500],
131 ])
132 def test_proxy_02_003(self, env, via, exp_status):
133 # make requests to a forward proxy https: vhost and GET
134 # a URL which carries the unix: domain socket.
135 # This needs to fail.
136 domain = f"{via}.{env.http_tld}"
137 r = env.run(args=[
138 'openssl', 's_client', '-connect', f"127.0.0.1:{env.https_port}",
139 '-servername', domain,
140 '-crlf', '-ign_eof',
141 '-CAfile', env.get_ca_pem_file(domain)
142 ], intext=f"""GET unix:{TestProxyUds.UDS_PATH}|http://127.0.0.1:{env.http_port}/alive.json HTTP/1.1
143Host: {domain}
144
145""")
146 assert r.exit_code == 0, f"{r.stdout}{r.stderr}"
147 lines = r.stdout.split('\n')
148 rlines = None
149 for idx, l in enumerate(lines):
150 if l.startswith('HTTP/'):
151 rlines = lines[idx:]
152 assert rlines, f"No response found in: {r.stdout}"
153 r2 = self.parse_response(rlines)
154 assert r2.response
155 assert r2.response['status'] == exp_status
156 #
157 env.httpd_error_log.ignore_recent(
158 lognos = [
159 "AH01144" # No protocol handler was valid for the URL
160 ]
161 )
162
163 def parse_response(self, lines) -> ExecResult:
164 exp_body = False

Callers

nothing calls this directly

Calls 4

parse_responseMethod · 0.95
ignore_recentMethod · 0.80
runMethod · 0.45
get_ca_pem_fileMethod · 0.45

Tested by

no test coverage detected