diff --git a/apps/emqx/test/emqx_channel_SUITE.erl b/apps/emqx/test/emqx_channel_SUITE.erl index 3383b1ee5..e8367de18 100644 --- a/apps/emqx/test/emqx_channel_SUITE.erl +++ b/apps/emqx/test/emqx_channel_SUITE.erl @@ -106,7 +106,7 @@ listener_mqtt_tcp_conf() -> mountpoint => <<>>, proxy_protocol => false, proxy_protocol_timeout => 3000, - tcp => #{ + tcp_options => #{ active_n => 100, backlog => 1024, buffer => 4096, @@ -128,7 +128,7 @@ listener_mqtt_ws_conf() -> mountpoint => <<>>, proxy_protocol => false, proxy_protocol_timeout => 3000, - tcp => + tcp_options => #{ active_n => 100, backlog => 1024, diff --git a/apps/emqx/test/emqx_client_SUITE.erl b/apps/emqx/test/emqx_client_SUITE.erl index c383f9d33..621e70c63 100644 --- a/apps/emqx/test/emqx_client_SUITE.erl +++ b/apps/emqx/test/emqx_client_SUITE.erl @@ -78,7 +78,7 @@ groups() -> init_per_suite(Config) -> emqx_common_test_helpers:boot_modules(all), emqx_common_test_helpers:start_apps([]), - emqx_config:put_listener_conf(ssl, default, [ssl, verify], verify_peer), + emqx_config:put_listener_conf(ssl, default, [ssl_options, verify], verify_peer), emqx_listeners:restart_listener('ssl:default'), Config. diff --git a/apps/emqx/test/emqx_connection_SUITE.erl b/apps/emqx/test/emqx_connection_SUITE.erl index 5f1ac66fc..b199565c2 100644 --- a/apps/emqx/test/emqx_connection_SUITE.erl +++ b/apps/emqx/test/emqx_connection_SUITE.erl @@ -256,9 +256,9 @@ t_handle_msg_deliver(_) -> t_handle_msg_inet_reply(_) -> ok = meck:expect(emqx_pd, get_counter, fun(_) -> 10 end), - emqx_config:put_listener_conf(tcp, default, [tcp, active_n], 0), + emqx_config:put_listener_conf(tcp, default, [tcp_options, active_n], 0), ?assertMatch({ok, _St}, handle_msg({inet_reply, for_testing, ok}, st())), - emqx_config:put_listener_conf(tcp, default, [tcp, active_n], 100), + emqx_config:put_listener_conf(tcp, default, [tcp_options, active_n], 100), ?assertEqual(ok, handle_msg({inet_reply, for_testing, ok}, st())), ?assertMatch( {stop, {shutdown, for_testing}, _St}, diff --git a/apps/emqx/test/emqx_listeners_SUITE.erl b/apps/emqx/test/emqx_listeners_SUITE.erl index f26e49c9b..a9d299d88 100644 --- a/apps/emqx/test/emqx_listeners_SUITE.erl +++ b/apps/emqx/test/emqx_listeners_SUITE.erl @@ -78,7 +78,7 @@ init_per_testcase(t_wss_conn, Config) -> listener_test => #{ bind => {{127, 0, 0, 1}, 9998}, limiter => #{}, - ssl => #{ + ssl_options => #{ cacertfile => ?CERTS_PATH("cacert.pem"), certfile => ?CERTS_PATH("cert.pem"), keyfile => ?CERTS_PATH("key.pem") diff --git a/apps/emqx/test/emqx_takeover_SUITE.erl b/apps/emqx/test/emqx_takeover_SUITE.erl index 1ef2942c5..ab3474a32 100644 --- a/apps/emqx/test/emqx_takeover_SUITE.erl +++ b/apps/emqx/test/emqx_takeover_SUITE.erl @@ -35,9 +35,9 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> ?check_trace( ?wait_async_action( - emqx_common_test_helpers:start_apps([]), + emqx_common_test_helpers:start_apps([emqx_conf]), #{?snk_kind := listener_started, bind := 1883}, - timer:seconds(5) + timer:seconds(10) ), fun(Trace) -> %% more than one listener diff --git a/apps/emqx_management/test/emqx_mgmt_api_listeners_SUITE.erl b/apps/emqx_management/test/emqx_mgmt_api_listeners_SUITE.erl index 29adfc302..8ea1ea718 100644 --- a/apps/emqx_management/test/emqx_mgmt_api_listeners_SUITE.erl +++ b/apps/emqx_management/test/emqx_mgmt_api_listeners_SUITE.erl @@ -96,7 +96,7 @@ crud_listeners_by_id(ListenerId, NewListenerId, MinListenerId, BadId, Type) -> MinConf = case OriginListener of #{ - <<"ssl">> := + <<"ssl_options">> := #{ <<"cacertfile">> := CaCertFile, <<"certfile">> := CertFile, @@ -107,7 +107,7 @@ crud_listeners_by_id(ListenerId, NewListenerId, MinListenerId, BadId, Type) -> <<"id">> => MinListenerId, <<"bind">> => <<"0.0.0.0:3883">>, <<"type">> => Type, - <<"ssl">> => #{ + <<"ssl_options">> => #{ <<"cacertfile">> => CaCertFile, <<"certfile">> => CertFile, <<"keyfile">> => KeyFile diff --git a/apps/emqx_modules/test/emqx_delayed_SUITE.erl b/apps/emqx_modules/test/emqx_delayed_SUITE.erl index 2dba326f6..c38d34641 100644 --- a/apps/emqx_modules/test/emqx_delayed_SUITE.erl +++ b/apps/emqx_modules/test/emqx_delayed_SUITE.erl @@ -30,11 +30,18 @@ %%-------------------------------------------------------------------- %% Setups %%-------------------------------------------------------------------- +-define(BASE_CONF, #{ + <<"dealyed">> => <<"true">>, + <<"max_delayed_messages">> => <<"0">> +}). all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ + raw_with_default => true + }), emqx_common_test_helpers:start_apps([emqx_conf, emqx_modules]), Config. diff --git a/apps/emqx_modules/test/emqx_delayed_api_SUITE.erl b/apps/emqx_modules/test/emqx_delayed_api_SUITE.erl index 0a17e12d2..dbed931a2 100644 --- a/apps/emqx_modules/test/emqx_delayed_api_SUITE.erl +++ b/apps/emqx_modules/test/emqx_delayed_api_SUITE.erl @@ -32,7 +32,7 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), diff --git a/apps/emqx_modules/test/emqx_rewrite_SUITE.erl b/apps/emqx_modules/test/emqx_rewrite_SUITE.erl index 36368aace..47c0abe11 100644 --- a/apps/emqx_modules/test/emqx_rewrite_SUITE.erl +++ b/apps/emqx_modules/test/emqx_rewrite_SUITE.erl @@ -160,7 +160,7 @@ t_rewrite_re_error(_Config) -> ok. t_list(_Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?REWRITE), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?REWRITE, #{ raw_with_default => true }), Expect = maps:get(<<"rewrite">>, ?REWRITE), @@ -168,7 +168,7 @@ t_list(_Config) -> ok. t_update(_Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?REWRITE), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?REWRITE, #{ raw_with_default => true }), Init = emqx_rewrite:list(), @@ -186,7 +186,7 @@ t_update(_Config) -> ok. t_update_disable(_Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?REWRITE), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?REWRITE, #{ raw_with_default => true }), ?assertEqual(ok, emqx_rewrite:update([])), @@ -203,7 +203,7 @@ t_update_disable(_Config) -> ok. t_update_re_failed(_Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?REWRITE), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?REWRITE, #{ raw_with_default => true }), Re = <<"*^test/*">>, @@ -260,7 +260,7 @@ receive_publish(Timeout) -> end. init() -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?REWRITE), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?REWRITE, #{ raw_with_default => true }), ok = emqx_rewrite:enable(), diff --git a/apps/emqx_modules/test/emqx_rewrite_api_SUITE.erl b/apps/emqx_modules/test/emqx_rewrite_api_SUITE.erl index d837006dd..19bcc007a 100644 --- a/apps/emqx_modules/test/emqx_rewrite_api_SUITE.erl +++ b/apps/emqx_modules/test/emqx_rewrite_api_SUITE.erl @@ -33,7 +33,7 @@ init_per_testcase(_, Config) -> Config. init_per_suite(Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), diff --git a/apps/emqx_modules/test/emqx_telemetry_SUITE.erl b/apps/emqx_modules/test/emqx_telemetry_SUITE.erl index ac5c8bf35..022fb0b5f 100644 --- a/apps/emqx_modules/test/emqx_telemetry_SUITE.erl +++ b/apps/emqx_modules/test/emqx_telemetry_SUITE.erl @@ -41,7 +41,7 @@ init_per_suite(Config) -> emqx_common_test_helpers:deps_path(emqx_authz, "etc/acl.conf") end ), - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), emqx_common_test_helpers:start_apps( @@ -176,7 +176,7 @@ init_per_testcase(t_uuid_restored_from_file, Config) -> %% clear the UUIDs in the DB {atomic, ok} = mria:clear_table(emqx_telemetry), emqx_common_test_helpers:stop_apps([emqx_conf, emqx_authn, emqx_authz, emqx_modules]), - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), emqx_common_test_helpers:start_apps( @@ -332,7 +332,7 @@ t_uuid_saved_to_file(_Config) -> %% clear the UUIDs in the DB {atomic, ok} = mria:clear_table(emqx_telemetry), emqx_common_test_helpers:stop_apps([emqx_conf, emqx_authn, emqx_authz, emqx_modules]), - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), emqx_common_test_helpers:start_apps( @@ -861,7 +861,7 @@ setup_slave(Node) -> Node, emqx_common_test_helpers, load_config, - [emqx_modules_schema, jsx:encode(?BASE_CONF), #{raw_with_default => true}] + [emqx_modules_schema, ?BASE_CONF, #{raw_with_default => true}] ), ok = rpc:call( Node, diff --git a/apps/emqx_modules/test/emqx_telemetry_api_SUITE.erl b/apps/emqx_modules/test/emqx_telemetry_api_SUITE.erl index 8c55583b6..d8e22cc1e 100644 --- a/apps/emqx_modules/test/emqx_telemetry_api_SUITE.erl +++ b/apps/emqx_modules/test/emqx_telemetry_api_SUITE.erl @@ -29,7 +29,7 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), diff --git a/apps/emqx_modules/test/emqx_topic_metrics_SUITE.erl b/apps/emqx_modules/test/emqx_topic_metrics_SUITE.erl index 2c38529f8..b2fa561b4 100644 --- a/apps/emqx_modules/test/emqx_topic_metrics_SUITE.erl +++ b/apps/emqx_modules/test/emqx_topic_metrics_SUITE.erl @@ -28,7 +28,7 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> emqx_common_test_helpers:boot_modules(all), - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?TOPIC), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?TOPIC, #{ raw_with_default => true }), emqx_common_test_helpers:start_apps([emqx_conf, emqx_modules]), diff --git a/apps/emqx_modules/test/emqx_topic_metrics_api_SUITE.erl b/apps/emqx_modules/test/emqx_topic_metrics_api_SUITE.erl index 8e57a8b79..09964b328 100644 --- a/apps/emqx_modules/test/emqx_topic_metrics_api_SUITE.erl +++ b/apps/emqx_modules/test/emqx_topic_metrics_api_SUITE.erl @@ -40,7 +40,7 @@ init_per_testcase(_, Config) -> Config. init_per_suite(Config) -> - ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?BASE_CONF), #{ + ok = emqx_common_test_helpers:load_config(emqx_modules_schema, ?BASE_CONF, #{ raw_with_default => true }), diff --git a/apps/emqx_psk/test/emqx_psk_SUITE.erl b/apps/emqx_psk/test/emqx_psk_SUITE.erl index 7a5a35646..816562a26 100644 --- a/apps/emqx_psk/test/emqx_psk_SUITE.erl +++ b/apps/emqx_psk/test/emqx_psk_SUITE.erl @@ -84,7 +84,7 @@ t_psk_lookup(_) -> reuseaddr => true, user_lookup_fun => {fun emqx_tls_psk:lookup/3, undefined} }, - emqx_config:put([listeners, ssl, default, ssl], ServerTLSOpts), + emqx_config:put([listeners, ssl, default, ssl_options], ServerTLSOpts), emqx_listeners:restart_listener('ssl:default'), {ok, Socket} = ssl:connect("127.0.0.1", 8883, maps:to_list(ClientTLSOpts)),