test(sys): refine prop_emqx_sys
This commit is contained in:
parent
ba6cfd595b
commit
ecc8d92e6c
|
@ -175,7 +175,7 @@ terminate(_Reason, #state{heartbeat = TRef1, ticker = TRef2}) ->
|
|||
lists:foreach(fun emqx_misc:cancel_timer/1, [TRef1, TRef2]).
|
||||
|
||||
unload_event_hooks() ->
|
||||
lists:foreach(fun(K, _) ->
|
||||
maps:foreach(fun(K, _) ->
|
||||
{HookPoint, Fun} = hook_and_fun(K),
|
||||
emqx_hooks:del(HookPoint, {?MODULE, Fun})
|
||||
end, sys_event_message()).
|
||||
|
|
|
@ -32,21 +32,3 @@ end_per_suite(_Config) ->
|
|||
application:unload(emqx),
|
||||
ok = emqx_logger:set_log_level(error),
|
||||
ok.
|
||||
|
||||
% t_version(_) ->
|
||||
% error('TODO').
|
||||
|
||||
% t_sysdescr(_) ->
|
||||
% error('TODO').
|
||||
|
||||
% t_datetime(_) ->
|
||||
% error('TODO').
|
||||
|
||||
% t_sys_interval(_) ->
|
||||
% error('TODO').
|
||||
|
||||
% t_sys_heatbeat_interval(_) ->
|
||||
% error('TODO').
|
||||
|
||||
% t_info(_) ->
|
||||
% error('TODO').
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
, emqx_stats
|
||||
, emqx_broker
|
||||
, mria_mnesia
|
||||
, emqx_hooks
|
||||
]).
|
||||
|
||||
-define(ALL(Vars, Types, Exprs),
|
||||
|
@ -59,8 +60,11 @@ prop_sys() ->
|
|||
|
||||
do_setup() ->
|
||||
ok = emqx_logger:set_log_level(emergency),
|
||||
emqx_config:put([broker, sys_msg_interval], 60000),
|
||||
emqx_config:put([broker, sys_heartbeat_interval], 30000),
|
||||
emqx_config:put([sys_topic, sys_msg_interval], 60000),
|
||||
emqx_config:put([sys_topic, sys_heartbeat_interval], 30000),
|
||||
emqx_config:put([sys_topic, sys_event_messages],
|
||||
#{client_connected => true, client_disconnected => true,
|
||||
client_subscribed => true, client_unsubscribed => true}),
|
||||
[mock(Mod) || Mod <- ?mock_modules],
|
||||
ok.
|
||||
|
||||
|
@ -83,7 +87,10 @@ do_mock(emqx_stats) ->
|
|||
do_mock(mria_mnesia) ->
|
||||
meck:expect(mria_mnesia, running_nodes, fun() -> [node()] end);
|
||||
do_mock(emqx_metrics) ->
|
||||
meck:expect(emqx_metrics, all, fun() -> [{hello, 3}] end).
|
||||
meck:expect(emqx_metrics, all, fun() -> [{hello, 3}] end);
|
||||
do_mock(emqx_hooks) ->
|
||||
meck:expect(emqx_hooks, put, fun(_HookPoint, _MFA) -> ok end),
|
||||
meck:expect(emqx_hooks, del, fun(_HookPoint, _MF) -> ok end).
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% MODEL
|
||||
|
|
Loading…
Reference in New Issue