(self, env)
| 57 | |
| 58 | @pytest.fixture(autouse=True, scope='class') |
| 59 | def _class_scope(self, env): |
| 60 | # setup 3 vhosts on https: for reverse, forward and |
| 61 | # mixed proxying to a unix: domain socket |
| 62 | # We setup a UDSFaker running that returns a fixed response |
| 63 | UDS_PATH = f"{env.gen_dir}/proxy_02.sock" |
| 64 | TestProxyUds.UDS_PATH = UDS_PATH |
| 65 | faker = UDSFaker(path=UDS_PATH) |
| 66 | faker.start() |
| 67 | |
| 68 | conf = HttpdConf(env) |
| 69 | conf.add("ProxyPreserveHost on") |
| 70 | conf.start_vhost(domains=[env.d_reverse], port=env.https_port) |
| 71 | conf.add([ |
| 72 | f"ProxyPass / unix:{UDS_PATH}|http://127.0.0.1:{env.http_port}/" |
| 73 | ]) |
| 74 | conf.end_vhost() |
| 75 | |
| 76 | conf.start_vhost(domains=[env.d_forward], port=env.https_port) |
| 77 | conf.add([ |
| 78 | "ProxyRequests on" |
| 79 | ]) |
| 80 | conf.end_vhost() |
| 81 | |
| 82 | conf.start_vhost(domains=[env.d_mixed], port=env.https_port) |
| 83 | conf.add([ |
| 84 | f"ProxyPass / unix:{UDS_PATH}|http://127.0.0.1:{env.http_port}/", |
| 85 | "ProxyRequests on" |
| 86 | ]) |
| 87 | conf.end_vhost() |
| 88 | conf.install() |
| 89 | assert env.apache_restart() == 0 |
| 90 | yield |
| 91 | faker.stop() |
| 92 | |
| 93 | @pytest.mark.parametrize(["via", "seen"], [ |
| 94 | ["reverse", "faked"], |
nothing calls this directly
no test coverage detected