Zhongwen Deng пре 3 година
родитељ
комит
5e92ef54c5

+ 2 - 2
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,

+ 1 - 1
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.
 

+ 2 - 2
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},

+ 1 - 1
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")

+ 2 - 2
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

+ 2 - 2
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

+ 7 - 0
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.
 

+ 1 - 1
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
     }),
 

+ 5 - 5
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(),

+ 1 - 1
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
     }),
 

+ 4 - 4
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,

+ 1 - 1
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
     }),
 

+ 1 - 1
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]),

+ 1 - 1
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
     }),
 

+ 1 - 1
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)),