fix(test): test case failed by unload
This commit is contained in:
parent
6378cd1f9a
commit
4317845482
|
@ -2,21 +2,25 @@
|
||||||
{VSN,
|
{VSN,
|
||||||
[
|
[
|
||||||
{"4.3.3", [
|
{"4.3.3", [
|
||||||
|
{apply, {emqx_metrics, ensure, [['client.acl.allow', 'client.acl.ignore', 'client.acl.deny']]}},
|
||||||
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{"4.3.2", [
|
{"4.3.2", [
|
||||||
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
||||||
|
{apply, {emqx_metrics, ensure, [['client.acl.allow', 'client.acl.ignore', 'client.acl.deny']]}},
|
||||||
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{"4.3.1", [
|
{"4.3.1", [
|
||||||
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
||||||
{load_module, emqx_mod_api_topic_metrics, brutal_purge, soft_purge, []},
|
{load_module, emqx_mod_api_topic_metrics, brutal_purge, soft_purge, []},
|
||||||
|
{apply, {emqx_metrics, ensure, [['client.acl.allow', 'client.acl.ignore', 'client.acl.deny']]}},
|
||||||
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{"4.3.0", [
|
{"4.3.0", [
|
||||||
{update, emqx_mod_delayed, {advanced, []}},
|
{update, emqx_mod_delayed, {advanced, []}},
|
||||||
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
{load_module, emqx_mod_presence, brutal_purge, soft_purge, []},
|
||||||
{load_module, emqx_mod_api_topic_metrics, brutal_purge, soft_purge, []},
|
{load_module, emqx_mod_api_topic_metrics, brutal_purge, soft_purge, []},
|
||||||
|
{apply, {emqx_metrics, ensure, [['client.acl.allow', 'client.acl.ignore', 'client.acl.deny']]}},
|
||||||
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
{load_module, emqx_mod_acl_internal, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{<<".*">>, []}
|
{<<".*">>, []}
|
||||||
|
|
|
@ -38,10 +38,12 @@ t_load_unload(_) ->
|
||||||
?assertEqual({error,already_exists}, emqx_mod_acl_internal:load([])).
|
?assertEqual({error,already_exists}, emqx_mod_acl_internal:load([])).
|
||||||
|
|
||||||
t_check_acl(_) ->
|
t_check_acl(_) ->
|
||||||
|
emqx_mod_acl_internal:load([]),
|
||||||
Rules=#{publish => [{allow,all}], subscribe => [{deny, all}]},
|
Rules=#{publish => [{allow,all}], subscribe => [{deny, all}]},
|
||||||
?assertEqual({ok, allow}, emqx_mod_acl_internal:check_acl(clientinfo(), publish, <<"t">>, [], Rules)),
|
?assertEqual({ok, allow}, emqx_mod_acl_internal:check_acl(clientinfo(), publish, <<"t">>, [], Rules)),
|
||||||
?assertEqual({ok, deny}, emqx_mod_acl_internal:check_acl(clientinfo(), subscribe, <<"t">>, [], Rules)),
|
?assertEqual({ok, deny}, emqx_mod_acl_internal:check_acl(clientinfo(), subscribe, <<"t">>, [], Rules)),
|
||||||
?assertEqual(ok, emqx_mod_acl_internal:check_acl(clientinfo(), connect, <<"t">>, [], Rules)).
|
?assertEqual(ok, emqx_mod_acl_internal:check_acl(clientinfo(), connect, <<"t">>, [], Rules)),
|
||||||
|
emqx_mod_acl_internal:unload([]).
|
||||||
|
|
||||||
t_reload_acl(_) ->
|
t_reload_acl(_) ->
|
||||||
?assertEqual(ok, emqx_mod_acl_internal:reload([])).
|
?assertEqual(ok, emqx_mod_acl_internal:reload([])).
|
||||||
|
|
Loading…
Reference in New Issue