fix seesion and connectiong test suites
This commit is contained in:
parent
3f42f1271b
commit
14ba395c21
|
@ -19,12 +19,29 @@
|
||||||
|
|
||||||
-include_lib("common_test/include/ct.hrl").
|
-include_lib("common_test/include/ct.hrl").
|
||||||
|
|
||||||
all() -> [t_attrs].
|
all() ->
|
||||||
|
[{group, connection}].
|
||||||
|
|
||||||
|
groups() ->
|
||||||
|
[{connection, [sequence], [t_attrs]}].
|
||||||
|
|
||||||
|
init_per_suite(Config) ->
|
||||||
|
emqx_ct_broker_helpers:run_setup_steps(),
|
||||||
|
Config.
|
||||||
|
|
||||||
|
end_per_suite(_Config) ->
|
||||||
|
emqx_ct_broker_helpers:run_teardown_steps().
|
||||||
|
|
||||||
|
|
||||||
t_attrs(_) ->
|
t_attrs(_) ->
|
||||||
emqx_ct_broker_helpers:run_setup_steps(),
|
|
||||||
{ok, C, _} = emqx_client:start_link([{host, "localhost"}, {client_id, <<"simpleClient">>}, {username, <<"plain">>}, {password, <<"plain">>}]),
|
{ok, C, _} = emqx_client:start_link([{host, "localhost"}, {client_id, <<"simpleClient">>}, {username, <<"plain">>}, {password, <<"plain">>}]),
|
||||||
[{<<"simpleClient">>, ConnPid}] = emqx_cm:lookup_connection(<<"simpleClient">>),
|
[{<<"simpleClient">>, ConnPid}] = emqx_cm:lookup_connection(<<"simpleClient">>),
|
||||||
Attrs = emqx_connection:attrs(ConnPid),
|
Attrs = emqx_connection:attrs(ConnPid),
|
||||||
<<"simpleClient">> = proplists:get_value(client_id, Attrs),
|
<<"simpleClient">> = proplists:get_value(client_id, Attrs),
|
||||||
<<"plain">> = proplists:get_value(username, Attrs).
|
<<"plain">> = proplists:get_value(username, Attrs),
|
||||||
|
emqx_client:disconnect(C).
|
||||||
|
|
||||||
|
%% t_stats() ->
|
||||||
|
%% {ok, C, _ } = emqx_client;
|
||||||
|
%% t_stats() ->
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,14 @@ all() ->
|
||||||
[start_stop_listeners,
|
[start_stop_listeners,
|
||||||
restart_listeners].
|
restart_listeners].
|
||||||
|
|
||||||
init_per_suite() ->
|
init_per_suite(Config) ->
|
||||||
NewConfig = generate_config(),
|
NewConfig = generate_config(),
|
||||||
application:ensure_all_started(esockd),
|
application:ensure_all_started(esockd),
|
||||||
lists:foreach(fun set_app_env/1, NewConfig),
|
lists:foreach(fun set_app_env/1, NewConfig),
|
||||||
ok.
|
Config.
|
||||||
|
|
||||||
end_per_suite() ->
|
end_per_suite(_Config) ->
|
||||||
application:stop(esockd),
|
application:stop(esockd).
|
||||||
ok.
|
|
||||||
|
|
||||||
start_stop_listeners(_) ->
|
start_stop_listeners(_) ->
|
||||||
ok = emqx_listeners:start(),
|
ok = emqx_listeners:start(),
|
||||||
|
|
|
@ -21,8 +21,14 @@
|
||||||
|
|
||||||
all() -> [t_session_all].
|
all() -> [t_session_all].
|
||||||
|
|
||||||
t_session_all(_) ->
|
init_per_suite(Config) ->
|
||||||
emqx_ct_broker_helpers:run_setup_steps(),
|
emqx_ct_broker_helpers:run_setup_steps(),
|
||||||
|
Config.
|
||||||
|
|
||||||
|
end_per_suite(_Config) ->
|
||||||
|
emqx_ct_broker_helpers:run_teardown_steps().
|
||||||
|
|
||||||
|
t_session_all(_) ->
|
||||||
ClientId = <<"ClientId">>,
|
ClientId = <<"ClientId">>,
|
||||||
{ok, ConnPid} = emqx_mock_client:start_link(ClientId),
|
{ok, ConnPid} = emqx_mock_client:start_link(ClientId),
|
||||||
{ok, SPid} = emqx_mock_client:open_session(ConnPid, ClientId, internal),
|
{ok, SPid} = emqx_mock_client:open_session(ConnPid, ClientId, internal),
|
||||||
|
|
Loading…
Reference in New Issue