0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Switch to running autobahntestsuite via Docker

This commit is contained in:
Loïc Hoguin 2025-01-15 13:12:27 +01:00
parent 1724575b42
commit 818b448ae9
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 11 additions and 3 deletions

View file

@ -51,7 +51,7 @@ end_per_group(Listener, _Config) ->
init_dispatch() -> init_dispatch() ->
cowboy_router:compile([ cowboy_router:compile([
{"localhost", [ {"host.docker.internal", [
{"/ws_echo", ws_echo, []} {"/ws_echo", ws_echo, []}
]} ]}
]). ]).
@ -73,7 +73,15 @@ autobahn_fuzzingclient(Config) ->
end. end.
do_start_port(Config, Pid) -> do_start_port(Config, Pid) ->
Port = open_port({spawn, "wstest -m fuzzingclient -s " ++ config(data_dir, Config) ++ "client.json"}, % Cmd = "wstest -m fuzzingclient -s " ++ config(data_dir, Config) ++ "client.json",
Cmd = "sudo docker run --rm "
"-v " ++ config(data_dir, Config) ++ "/client.json:/client.json "
"-v " ++ config(priv_dir, Config) ++ "/reports:/reports "
"--add-host=host.docker.internal:host-gateway "
"--name fuzzingclient "
"crossbario/autobahn-testsuite "
"wstest -m fuzzingclient -s client.json",
Port = open_port({spawn, Cmd},
[{line, 10000}, {cd, config(priv_dir, Config)}, binary, eof]), [{line, 10000}, {cd, config(priv_dir, Config)}, binary, eof]),
do_receive_infinity(Port, Pid). do_receive_infinity(Port, Pid).

View file

@ -4,7 +4,7 @@
"servers": [{ "servers": [{
"agent": "Cowboy", "agent": "Cowboy",
"url": "ws://localhost:33080/ws_echo", "url": "ws://host.docker.internal:33080/ws_echo",
"options": {"version": 18} "options": {"version": 18}
}], }],