test: switch `emqx_authz_file_SUITE` to use new tooling

This commit is contained in:
Andrew Mayorov 2023-06-23 17:27:27 +02:00
parent 2c50e61cee
commit fc709a14cc
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 10 additions and 22 deletions

View File

@ -39,33 +39,21 @@ groups() ->
[].
init_per_suite(Config) ->
ok = emqx_common_test_helpers:start_apps(
[emqx_conf, emqx_authz],
fun set_special_configs/1
),
%% meck after authz started
meck:expect(
emqx_authz,
acl_conf_file,
fun() ->
emqx_common_test_helpers:deps_path(emqx_authz, "etc/acl.conf")
end
),
Config.
end_per_suite(_Config) ->
ok = emqx_authz_test_lib:restore_authorizers(),
ok = emqx_common_test_helpers:stop_apps([emqx_conf, emqx_authz]).
init_per_testcase(_TestCase, Config) ->
ok = emqx_authz_test_lib:reset_authorizers(),
Config.
set_special_configs(emqx_authz) ->
ok = emqx_authz_test_lib:reset_authorizers();
set_special_configs(_) ->
ok.
init_per_testcase(TestCase, Config) ->
Apps = emqx_cth_suite:start(
[{emqx_conf, "authorization.no_match = deny"}, emqx_authz],
#{work_dir => filename:join(?config(priv_dir, Config), TestCase)}
),
[{tc_apps, Apps} | Config].
end_per_testcase(_TestCase, Config) ->
emqx_cth_suite:stop(?config(tc_apps, Config)).
%%------------------------------------------------------------------------------
%% Testcases
%%------------------------------------------------------------------------------