Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/modules/http2/test_800_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,19 @@ def ws_run(env: H2TestEnv, path, authority=None, do_input=None, inbytes=None,
reason=f'websockets is {ws_version}, need at least {ws_version_min}')
class TestWebSockets:

def _build_clients(self, env):
clients_dir = os.path.join(os.path.dirname(env.clients_dir), 'clients')
p = subprocess.run(['make'], capture_output=True, cwd=clients_dir)
rv = p.returncode
if rv != 0:
log.error(f"compiling test clients failed: {p.stderr}")
raise Exception(f"compiling test clients failed: {p.stderr}")

@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
# create the H2ws binary needed in some of the tests
self._build_clients(env)

# Apache config that CONNECT proxies a WebSocket server for paths starting
# with '/ws/'
# The WebSocket server is started in pytest fixture 'ws_server' below.
Expand Down
15 changes: 0 additions & 15 deletions test/pyhttpd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def make(self):
self._make_htdocs()

self._add_aptest()
self._build_clients()
self.env.clear_curl_headerfiles()

def _make_dirs(self):
Expand Down Expand Up @@ -256,20 +255,6 @@ def _add_aptest(self):
with open(modules_conf, 'a') as fd:
# load our test module
fd.write(f"LoadModule aptest_module \"{module_dir}/mod_aptest.so\"\n")

def _build_clients(self):
if self.env.test_modules_dir:
return
clients_dir = os.path.join(
os.path.dirname(os.path.dirname(inspect.getfile(HttpdTestSetup))),
'clients')
p = subprocess.run(['make'], capture_output=True, cwd=clients_dir)
rv = p.returncode
if rv != 0:
log.error(f"compiling test clients failed: {p.stderr}")
raise Exception(f"compiling test clients failed: {p.stderr}")


class HttpdTestEnv:

LIBEXEC_DIR = None
Expand Down