25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

Handle gracefully that mnesia is already loaded when starting tests

This commit is contained in:
Paweł Chmielowski 2018-02-16 16:49:39 +01:00
parent 7e1df0752a
commit 71a856deaa

View File

@ -89,8 +89,14 @@ init_config(Config) ->
ConfigPath = filename:join([CWD, "ejabberd.yml"]), ConfigPath = filename:join([CWD, "ejabberd.yml"]),
ok = file:write_file(ConfigPath, CfgContent2), ok = file:write_file(ConfigPath, CfgContent2),
setup_ejabberd_lib_path(Config), setup_ejabberd_lib_path(Config),
ok = application:load(sasl), case application:load(sasl) of
ok = application:load(mnesia), ok -> ok;
{error, {already_loaded, _}} -> ok
end,
case application:load(mnesia) of
ok -> ok;
{error, {already_loaded, _}} -> ok
end,
case application:load(ejabberd) of case application:load(ejabberd) of
ok -> ok; ok -> ok;
{error, {already_loaded, _}} -> ok {error, {already_loaded, _}} -> ok