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

Don't start hosts for disabled backends from CT_BACKENDS passed to make test

This commit is contained in:
Paweł Chmielowski 2017-11-03 14:44:13 +01:00
parent 90e1f3f29d
commit ec3ea61585

View File

@ -69,9 +69,23 @@ init_config(Config) ->
{pgsql_db, <<"ejabberd_test">>},
{pgsql_user, <<"ejabberd_test">>},
{pgsql_pass, <<"ejabberd_test">>}
]),
]),
Backends = get_config_backends(),
io:format(standard_error, "BACKENT ~p~n", [Backends]),
HostTypes = re:split(CfgContent, "(\\s*- \"(.*)\\.localhost\")",
[group, {return, binary}]),
CfgContent2 = lists:foldl(fun([Pre, Frag, Type], Acc) ->
case Backends == all orelse lists:member(binary_to_list(Type), Backends) of
true ->
<<Acc/binary, Pre/binary, Frag/binary>>;
_ ->
<<Acc/binary, Pre/binary>>
end;
([Rest], Acc) ->
<<Acc/binary, Rest/binary>>
end, <<>>, HostTypes),
ConfigPath = filename:join([CWD, "ejabberd.yml"]),
ok = file:write_file(ConfigPath, CfgContent),
ok = file:write_file(ConfigPath, CfgContent2),
setup_ejabberd_lib_path(Config),
ok = application:load(sasl),
ok = application:load(mnesia),
@ -111,7 +125,7 @@ init_config(Config) ->
{master_resource, <<"master_resource!@#$%^&*()'\"`~<>+-/;:_=[]{}|\\">>},
{slave_resource, <<"slave_resource!@#$%^&*()'\"`~<>+-/;:_=[]{}|\\">>},
{password, Password},
{backends, get_config_backends()}
{backends, Backends}
|Config].
find_top_dir(Dir) ->