From ec3ea6158519bcd1020f5cc759661eb17fb46d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Fri, 3 Nov 2017 14:44:13 +0100 Subject: [PATCH] Don't start hosts for disabled backends from CT_BACKENDS passed to make test --- test/suite.erl | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/suite.erl b/test/suite.erl index 6bd96002a..14f0090d4 100644 --- a/test/suite.erl +++ b/test/suite.erl @@ -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 -> + <>; + _ -> + <> + end; + ([Rest], Acc) -> + <> + 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) ->