Skip to content

Commit

Permalink
Switch to running autobahntestsuite via Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Jan 15, 2025
1 parent 1724575 commit 818b448
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions test/ws_autobahn_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end_per_group(Listener, _Config) ->

init_dispatch() ->
cowboy_router:compile([
{"localhost", [
{"host.docker.internal", [
{"/ws_echo", ws_echo, []}
]}
]).
Expand All @@ -73,7 +73,15 @@ autobahn_fuzzingclient(Config) ->
end.

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]),
do_receive_infinity(Port, Pid).

Expand Down
2 changes: 1 addition & 1 deletion test/ws_autobahn_SUITE_data/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

Expand Down

0 comments on commit 818b448

Please sign in to comment.