test: conf_app ct failed
This commit is contained in:
parent
09160383f5
commit
b07befbf56
|
@ -67,6 +67,7 @@ mix.lock
|
|||
apps/emqx/test/emqx_static_checks_data/master.bpapi
|
||||
# rendered configurations
|
||||
*.conf.rendered
|
||||
*.conf.rendered.*
|
||||
lux_logs/
|
||||
/.prepare
|
||||
bom.json
|
||||
|
|
|
@ -409,7 +409,7 @@ catch_call(F) ->
|
|||
{crashed, {C, E, S}}
|
||||
end.
|
||||
force_set_config_file_paths(emqx_conf, [Path] = Paths) ->
|
||||
Bin = iolist_to_binary(io_lib:format("node.config_files = [~p]", [Path])),
|
||||
Bin = iolist_to_binary(io_lib:format("node.config_files = [~p]~n", [Path])),
|
||||
ok = file:write_file(Path, Bin, [append]),
|
||||
application:set_env(emqx, config_files, Paths);
|
||||
force_set_config_file_paths(emqx, Paths) ->
|
||||
|
|
|
@ -92,6 +92,14 @@ set_data_dir_env() ->
|
|||
Node = atom_to_list(node()),
|
||||
%% will create certs and authz dir
|
||||
ok = filelib:ensure_dir(Node ++ "/configs/"),
|
||||
{ok, [ConfigFile]} = application:get_env(emqx, config_files),
|
||||
NewConfigFile = ConfigFile ++ "." ++ Node,
|
||||
{ok, _} = file:copy(ConfigFile, NewConfigFile),
|
||||
Bin = iolist_to_binary(io_lib:format("node.config_files = [~p]~n", [NewConfigFile])),
|
||||
ok = file:write_file(NewConfigFile, Bin, [append]),
|
||||
DataDir = iolist_to_binary(io_lib:format("node.data_dir = ~p~n", [Node])),
|
||||
ok = file:write_file(NewConfigFile, DataDir, [append]),
|
||||
application:set_env(emqx, config_files, [NewConfigFile]),
|
||||
application:set_env(emqx, data_dir, Node),
|
||||
application:set_env(emqx, cluster_override_conf_file, Node ++ "/configs/cluster-override.conf"),
|
||||
ok.
|
||||
|
|
Loading…
Reference in New Issue