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

Method _class_scope

test/modules/proxy/test_02_unix.py:59–91  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

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"],

Callers

nothing calls this directly

Calls 9

startMethod · 0.95
addMethod · 0.95
start_vhostMethod · 0.95
end_vhostMethod · 0.95
installMethod · 0.95
stopMethod · 0.95
HttpdConfClass · 0.90
UDSFakerClass · 0.85
apache_restartMethod · 0.80

Tested by

no test coverage detected