|
@@ -21,6 +21,12 @@
|
|
|
-compile(export_all).
|
|
-compile(export_all).
|
|
|
-compile(nowarn_export_all).
|
|
-compile(nowarn_export_all).
|
|
|
|
|
|
|
|
|
|
+-define(CONF_DEFAULT, <<"""
|
|
|
|
|
+gateway: {
|
|
|
|
|
+ stomp.1 {}
|
|
|
|
|
+}
|
|
|
|
|
+""">>).
|
|
|
|
|
+
|
|
|
all() -> emqx_ct:all(?MODULE).
|
|
all() -> emqx_ct:all(?MODULE).
|
|
|
|
|
|
|
|
%%--------------------------------------------------------------------
|
|
%%--------------------------------------------------------------------
|
|
@@ -28,37 +34,14 @@ all() -> emqx_ct:all(?MODULE).
|
|
|
%%--------------------------------------------------------------------
|
|
%%--------------------------------------------------------------------
|
|
|
|
|
|
|
|
init_per_suite(Cfg) ->
|
|
init_per_suite(Cfg) ->
|
|
|
- emqx_ct_helpers:start_apps([emqx_gateway], fun set_special_configs/1),
|
|
|
|
|
|
|
+ ok = emqx_config:init_load(emqx_gateway_schema, ?CONF_DEFAULT),
|
|
|
|
|
+ emqx_ct_helpers:start_apps([emqx_gateway]),
|
|
|
Cfg.
|
|
Cfg.
|
|
|
|
|
|
|
|
end_per_suite(_Cfg) ->
|
|
end_per_suite(_Cfg) ->
|
|
|
emqx_ct_helpers:stop_apps([emqx_gateway]),
|
|
emqx_ct_helpers:stop_apps([emqx_gateway]),
|
|
|
ok.
|
|
ok.
|
|
|
|
|
|
|
|
-set_special_configs(emqx_gateway) ->
|
|
|
|
|
- emqx_config:put(
|
|
|
|
|
- [emqx_gateway],
|
|
|
|
|
- #{stomp =>
|
|
|
|
|
- #{'1' =>
|
|
|
|
|
- #{authenticator => allow_anonymous,
|
|
|
|
|
- clientinfo_override =>
|
|
|
|
|
- #{password => "${Packet.headers.passcode}",
|
|
|
|
|
- username => "${Packet.headers.login}"},
|
|
|
|
|
- frame =>
|
|
|
|
|
- #{max_body_length => 8192,
|
|
|
|
|
- max_headers => 10,
|
|
|
|
|
- max_headers_length => 1024},
|
|
|
|
|
- listener =>
|
|
|
|
|
- #{tcp =>
|
|
|
|
|
- #{'1' =>
|
|
|
|
|
- #{acceptors => 16,active_n => 100,backlog => 1024,
|
|
|
|
|
- bind => 61613,high_watermark => 1048576,
|
|
|
|
|
- max_conn_rate => 1000,max_connections => 1024000,
|
|
|
|
|
- send_timeout => 15000,send_timeout_close => true}}}}}}),
|
|
|
|
|
- ok;
|
|
|
|
|
-set_special_configs(_) ->
|
|
|
|
|
- ok.
|
|
|
|
|
-
|
|
|
|
|
%%--------------------------------------------------------------------
|
|
%%--------------------------------------------------------------------
|
|
|
%% Test cases
|
|
%% Test cases
|
|
|
%%--------------------------------------------------------------------
|
|
%%--------------------------------------------------------------------
|
|
@@ -84,4 +67,3 @@ t_load_unload(_) ->
|
|
|
|
|
|
|
|
init([paramsin]) ->
|
|
init([paramsin]) ->
|
|
|
{ok, _GwState = #{gwstate => 1}}.
|
|
{ok, _GwState = #{gwstate => 1}}.
|
|
|
-
|
|
|