Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions big_tests/tests/cets_disco_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,29 @@ suite() ->
%% Init & teardown
%%--------------------------------------------------------------------

init_per_suite(Config) ->
case ct_helper:get_internal_database() of
cets -> Config;
_ -> {skip, "No CETS enabled"}
end.

end_per_suite(_Config) ->
ok.

init_per_group(rdbms, Config) ->
case not ct_helper:is_ct_running()
orelse mongoose_helper:is_rdbms_enabled(domain_helper:host_type()) of
false -> {skip, rdbms_or_ct_not_running};
case not ct_helper:is_ct_running() orelse mongoose_helper:is_rdbms_enabled(domain_helper:host_type()) of
false ->
{skip, rdbms_or_ct_not_running};
true ->
Config1 = backup_cets_config(Config),
stop_and_delete_cets_discovery_if_running(),
Config
Config1
end;
init_per_group(_, Config) ->
Config.

end_per_group(rdbms, Config) ->
restore_cets_config(Config),
restore_default_cets_discovery(),
Config;
end_per_group(_, Config) ->
Expand Down Expand Up @@ -259,6 +270,19 @@ address_please_returns_ip_127_0_0_1_from_db(_Config) ->
%% Helpers
%%--------------------------------------------------------------------

backup_cets_config(Config) ->
Key = [internal_databases, cets],
Value1 = rpc(mim(), mongoose_config, get_opt, [Key]),
Value2 = rpc(mim2(), mongoose_config, get_opt, [Key]),
[{cets_mim, Value1}, {cets_mim2, Value2} | Config].

restore_cets_config(Config) ->
Key = [internal_databases, cets],
Value1 = proplists:get_value(cets_mim, Config),
rpc(mim(), mongoose_config, set_opt, [Key, Value1]),
Value2 = proplists:get_value(cets_mim2, Config),
rpc(mim2(), mongoose_config, set_opt, [Key, Value2]).

init_and_get_nodes(RPCNode, Opts, ExpectedNodes) ->
StateIn = disco_init(RPCNode, Opts),
get_nodes(RPCNode, StateIn, ExpectedNodes, false).
Expand Down
4 changes: 2 additions & 2 deletions tools/make-certs-cache-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
week=$(date "+%V")
((num=$week - $week % 2))
year=$(date "+%Y")
makefile_sum=$(sha1sum tools/ssl/Makefile | cut -d " " -f1)
ssl_sum=$(cat tools/ssl/Makefile tools/ssl/*.cnf | sha1sum | awk '{print $1}')

# Change it once incompatible changes are made in tools/ssl/ directory
CERT_KEY_VERSION=1
Expand All @@ -14,4 +14,4 @@ CERT_KEY_VERSION=1
# Change it to invalidate cache without making code changes
# There is no way to see the current value in the Circle CI settings though.
# To get the current value, run a CI job and check the output of the "Prepare cache key" task.
echo "${year}-week${num}-${makefile_sum}-${CERT_KEY_VERSION}-${CI_CERT_KEY_VERSION}"
echo "${year}-week${num}-${ssl_sum}-${CERT_KEY_VERSION}-${CI_CERT_KEY_VERSION}"
2 changes: 1 addition & 1 deletion tools/ssl/openssl-mongooseim.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ commonName = MongooseIM
subjectKeyIdentifier = hash
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
Comment thread
kamilwaz marked this conversation as resolved.
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alternate_names
nsComment = "Fake Dev-Only Certificate"

Expand Down