test: switch `emqx_broker_SUITE` to use new cth tooling

This commit is contained in:
Andrew Mayorov 2023-08-29 21:17:07 +04:00
parent 3268093881
commit 0e770bdc95
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 31 additions and 16 deletions

View File

@ -58,39 +58,54 @@ groups() ->
init_per_group(connected_client_count_group, Config) -> init_per_group(connected_client_count_group, Config) ->
Config; Config;
init_per_group(tcp, Config) -> init_per_group(tcp, Config) ->
emqx_common_test_helpers:boot_modules(all), Apps = emqx_cth_suite:start(
emqx_common_test_helpers:start_apps([]), [emqx],
[{conn_fun, connect} | Config]; #{work_dir => emqx_cth_suite:work_dir(Config)}
),
[{conn_fun, connect}, {group_apps, Apps} | Config];
init_per_group(ws, Config) -> init_per_group(ws, Config) ->
emqx_common_test_helpers:boot_modules(all), Apps = emqx_cth_suite:start(
emqx_common_test_helpers:start_apps([]), [emqx],
#{work_dir => emqx_cth_suite:work_dir(Config)}
),
[ [
{ssl, false}, {ssl, false},
{enable_websocket, true}, {enable_websocket, true},
{conn_fun, ws_connect}, {conn_fun, ws_connect},
{port, 8083}, {port, 8083},
{host, "localhost"} {host, "localhost"},
{group_apps, Apps}
| Config | Config
]; ];
init_per_group(quic, Config) -> init_per_group(quic, Config) ->
emqx_common_test_helpers:boot_modules(all), Apps = emqx_cth_suite:start(
emqx_common_test_helpers:start_apps([]), [
UdpPort = 14567, {emqx,
ok = emqx_common_test_helpers:ensure_quic_listener(?MODULE, UdpPort), "listeners.quic.test {"
"\n enable = true"
"\n max_connections = 1024000"
"\n idle_timeout = 15s"
"\n }"}
],
#{work_dir => emqx_cth_suite:work_dir(Config)}
),
[ [
{conn_fun, quic_connect}, {conn_fun, quic_connect},
{port, UdpPort} {port, emqx_config:get([listeners, quic, test, bind])},
{group_apps, Apps}
| Config | Config
]; ];
init_per_group(_Group, Config) -> init_per_group(_Group, Config) ->
emqx_common_test_helpers:boot_modules(all), Apps = emqx_cth_suite:start(
emqx_common_test_helpers:start_apps([]), [emqx],
Config. #{work_dir => emqx_cth_suite:work_dir(Config)}
),
[{group_apps, Apps} | Config].
end_per_group(connected_client_count_group, _Config) -> end_per_group(connected_client_count_group, _Config) ->
ok; ok;
end_per_group(_Group, _Config) -> end_per_group(_Group, Config) ->
emqx_common_test_helpers:stop_apps([]). emqx_cth_suite:stop(?config(group_apps, Config)).
init_per_suite(Config) -> init_per_suite(Config) ->
Config. Config.