|
|
@@ -23,6 +23,7 @@
|
|
|
""").
|
|
|
|
|
|
array_nodes_test() ->
|
|
|
+ ensure_acl_conf(),
|
|
|
ExpectNodes = ['emqx1@127.0.0.1', 'emqx2@127.0.0.1'],
|
|
|
lists:foreach(
|
|
|
fun(Nodes) ->
|
|
|
@@ -133,6 +134,7 @@ outdated_log_test() ->
|
|
|
validate_log(?OUTDATED_LOG_CONF).
|
|
|
|
|
|
validate_log(Conf) ->
|
|
|
+ ensure_acl_conf(),
|
|
|
BaseConf = to_bin(?BASE_CONF, ["emqx1@127.0.0.1", "emqx1@127.0.0.1"]),
|
|
|
Conf0 = <<BaseConf/binary, (list_to_binary(Conf))/binary>>,
|
|
|
{ok, ConfMap0} = hocon:binary(Conf0, #{format => richmap}),
|
|
|
@@ -199,6 +201,7 @@ log_test() ->
|
|
|
|
|
|
%% erlfmt-ignore
|
|
|
log_rotation_count_limit_test() ->
|
|
|
+ ensure_acl_conf(),
|
|
|
Format =
|
|
|
"""
|
|
|
log.file {
|
|
|
@@ -271,6 +274,7 @@ log_rotation_count_limit_test() ->
|
|
|
).
|
|
|
|
|
|
authn_validations_test() ->
|
|
|
+ ensure_acl_conf(),
|
|
|
BaseConf = to_bin(?BASE_CONF, ["emqx1@127.0.0.1", "emqx1@127.0.0.1"]),
|
|
|
|
|
|
OKHttps = to_bin(?BASE_AUTHN_ARRAY, [post, true, <<"https://127.0.0.1:8080">>]),
|
|
|
@@ -328,6 +332,7 @@ authn_validations_test() ->
|
|
|
).
|
|
|
|
|
|
listeners_test() ->
|
|
|
+ ensure_acl_conf(),
|
|
|
BaseConf = to_bin(?BASE_CONF, ["emqx1@127.0.0.1", "emqx1@127.0.0.1"]),
|
|
|
|
|
|
Conf = <<BaseConf/binary, ?LISTENERS>>,
|
|
|
@@ -402,6 +407,7 @@ authentication_headers(Conf) ->
|
|
|
Headers.
|
|
|
|
|
|
doc_gen_test() ->
|
|
|
+ ensure_acl_conf(),
|
|
|
%% the json file too large to encode.
|
|
|
{
|
|
|
timeout,
|
|
|
@@ -424,3 +430,11 @@ doc_gen_test() ->
|
|
|
|
|
|
to_bin(Format, Args) ->
|
|
|
iolist_to_binary(io_lib:format(Format, Args)).
|
|
|
+
|
|
|
+ensure_acl_conf() ->
|
|
|
+ File = emqx_schema:naive_env_interpolation(<<"${EMQX_ETC_DIR}/acl.conf">>),
|
|
|
+ ok = filelib:ensure_dir(filename:dirname(File)),
|
|
|
+ case filelib:is_regular(File) of
|
|
|
+ true -> ok;
|
|
|
+ false -> file:write_file(File, <<"">>)
|
|
|
+ end.
|