-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3108 from esl/multi-tenancy-tests
Multi tenancy tests
- Loading branch information
Showing
10 changed files
with
193 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
%% Options defined here are used when testing dynamic domains, see 'dynamic_domains.spec' | ||
%% They take precedence over 'test.config' | ||
|
||
{hosts, [{mim, [{node, mongooseim@localhost}, | ||
{domain, <<"domain.example.com">>}, | ||
{secondary_domain, <<"domain.example.org">>}, | ||
{dynamic_domains, [<<"domain.example.com">>, <<"domain.example.org">>]}, | ||
{vars, "mim1"}, | ||
{cluster, mim}, | ||
{s2s_port, 5269}, | ||
{incoming_s2s_port, 5269}, | ||
{metrics_rest_port, 5288}, | ||
{c2s_port, 5222}, | ||
{c2s_tls_port, 5223}, | ||
{cowboy_port, 5280}, | ||
{cowboy_secure_port, 5285}, | ||
{http_api_client_endpoint_port, 8089}, | ||
{service_port, 8888}, | ||
{kicking_service_port, 8666}, | ||
{hidden_service_port, 8189}, | ||
{gd_endpoint_port, 5555}, | ||
{http_notifications_port, 8000}]} | ||
]}. | ||
|
||
{escalus_users, [ | ||
{alice, [ | ||
{username, <<"alicE">>}, | ||
{server, <<"domain.example.com">>}, | ||
{host, <<"localhost">>}, | ||
{password, <<"matygrysa">>}]}, | ||
{alice_bis, [ | ||
{username, <<"alicE">>}, | ||
{server, <<"domain.example.org">>}, | ||
{host, <<"localhost">>}, | ||
{password, <<"matygrysa">>}]}, | ||
{bob, [ | ||
{username, <<"bOb">>}, | ||
{server, <<"domain.example.com">>}, | ||
{host, <<"localhost">>}, | ||
{password, <<"makrolika">>}]} | ||
]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%% Spec examples: | ||
%% | ||
%% {suites, "tests", amp_SUITE}. | ||
%% {groups, "tests", amp_SUITE, [discovery]}. | ||
%% {groups, "tests", amp_SUITE, [discovery], {cases, [stream_feature_test]}}. | ||
%% {cases, "tests", amp_SUITE, [stream_feature_test]}. | ||
%% | ||
%% For more info see: | ||
%% http://www.erlang.org/doc/apps/common_test/run_test_chapter.html#test_specifications | ||
{include, "tests"}. | ||
|
||
{suites, "tests", domain_isolation_SUITE}. | ||
|
||
{config, ["dynamic_domains.config", "test.config"]}. | ||
{logdir, "ct_report"}. | ||
|
||
%% ct_tty_hook will log CT failures to TTY verbosely | ||
%% ct_mongoose_hook will: | ||
%% * log suite start/end events in the MongooseIM console | ||
%% * ensure preset value is passed to ct Config | ||
%% * check server's purity after SUITE | ||
{ct_hooks, [ct_groups_summary_hook, ct_tty_hook, ct_mongoose_hook, ct_progress_hook, | ||
ct_mim_config_hook, | ||
ct_markdown_errors_hook, | ||
{ct_mongoose_log_hook, [ejabberd_node, ejabberd_cookie]}, | ||
{ct_mongoose_log_hook, [ejabberd2_node, ejabberd_cookie]} | ||
]}. | ||
|
||
%% To enable printing group and case enters on server side | ||
%%{ct_hooks, [{ct_mongoose_hook, [print_group, print_case]}]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-module(domain_helper). | ||
|
||
-export([insert_configured_domains/0, | ||
delete_configured_domains/0, | ||
insert_domain/2, | ||
delete_domain/2]). | ||
|
||
-import(distributed_helper, [get_or_fail/1, rpc/4]). | ||
|
||
insert_configured_domains() -> | ||
for_each_configured_domain(fun insert_domain/2). | ||
|
||
delete_configured_domains() -> | ||
for_each_configured_domain(fun delete_domain/2). | ||
|
||
insert_domain(Node, Domain) -> | ||
ok = rpc(Node, mongoose_domain_core, insert, [Domain, host_type(), dummy_source]). | ||
|
||
delete_domain(Node, Domain) -> | ||
ok = rpc(Node, mongoose_domain_core, delete, [Domain]). | ||
|
||
for_each_configured_domain(F) -> | ||
[F(#{node => proplists:get_value(node, Opts)}, Domain) || | ||
{_, Opts} <- ct:get_config(hosts), | ||
Domain <- proplists:get_value(dynamic_domains, Opts, [])]. | ||
|
||
host_type() -> | ||
<<"test type">>. %% preconfigured in the toml file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.