Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muc test fix #835

Merged
merged 5 commits into from Jun 7, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 9 additions & 12 deletions rel/files/ejabberd.cfg
Expand Up @@ -662,18 +662,15 @@
% default: 600 seconds
% {resume_timeout, 600}
]},
% {mod_muc_light, [
% {host, "muclight.@HOST@"}
% ]},
{mod_muc, [
{host, "muc.@HOST@"},
{access, muc},
{access_create, muc_create}
]},
{mod_muc_log, [
{outdir, "/tmp/muclogs"},
{access_log, muc}
]},
%% {mod_muc_light, [{host, "muclight.@HOST@"}]},
%% {mod_muc, [{host, "muc.@HOST@"},
%% {access, muc},
%% {access_create, muc_create}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to disable mod_muc by default? I know one can enable it in config file, but most users who just want to try it will probably never touch config file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't MUC obsolete?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did XSF obsolete MUC? We can say it's obsolete, I'm fine with it but then we should enable by default mod_muc_light.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be simpler to check if these two can peacefully coexist on separate subdomains?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly my point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The market says MUC is obsolete, the XSF won't say it, or until MIX is widely deployed.

Indeed: MUC, MUC light, and MIX can co-exist.

%% ]},
%% {mod_muc_log, [
%% {outdir, "/tmp/muclogs"},
%% {access_log, muc}
%% ]},
{{mod_offline}}
{{mod_privacy}}
{{mod_private}}
Expand Down
20 changes: 10 additions & 10 deletions rel/files/ejabberd.cfg.token-support
Expand Up @@ -630,16 +630,16 @@
% default: 600 seconds
% {resume_timeout, 600}
]},
{mod_muc, [
{host, "muc.@HOST@"},
{access, muc},
{access_create, muc_create}
]},
{mod_muc_log,
[
{outdir, "/tmp/muclogs"},
{access_log, muc}
]},
%{mod_muc, [
%{host, "muc.@HOST@"},
%{access, muc},
%{access_create, muc_create}
%]},
%{mod_muc_log,
%[
%{outdir, "/tmp/muclogs"},
%{access_log, muc}
%]},
{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
{mod_privacy, []},
{mod_private, []},
Expand Down
14 changes: 7 additions & 7 deletions test/ejabberd_tests/tests/component_SUITE.erl
Expand Up @@ -210,16 +210,16 @@ try_registering_component_twice(Config) ->
ok = escalus_connection:stop(Comp1).

try_registering_existing_host(Config) ->
%% Given a external muc component
Component = spec(muc_component, Config),
%% Given a external vjud component
Component = spec(vjud_component, Config),

try
%% When trying to connect it to the server
{Comp, _Addr, _} = connect_component(Component),
ok = escalus_connection:stop(Comp),
ct:fail("muc component connected successfully")
ct:fail("vjud component connected successfully")
catch {stream_error, _} ->
%% Then it should fail since muc service already exists on the server
%% Then it should fail since vjud service already exists on the server
ok
end.

Expand Down Expand Up @@ -433,7 +433,7 @@ register_same_on_both(Config) ->
%%--------------------------------------------------------------------

get_components(Opts, Config) ->
Components = [component1, component2, muc_component],
Components = [component1, component2, vjud_component],
[ {C, Opts ++ spec(C, Config)} || C <- Components ] ++ Config.

connect_component(Component) ->
Expand Down Expand Up @@ -559,8 +559,8 @@ spec(component_on_2, Config) ->
[{component, <<"yet_another_service">>}] ++ common(Config, 8899);
spec(component_duplicate, Config) ->
[{component, <<"another_service">>}] ++ common(Config, 8899);
spec(muc_component, Config) ->
[{component, <<"muc">>}] ++ common(Config).
spec(vjud_component, Config) ->
[{component, <<"vjud">>}] ++ common(Config).

common(Config) ->
common(Config, 8888).
Expand Down
2 changes: 2 additions & 0 deletions test/ejabberd_tests/tests/mam_SUITE.erl
Expand Up @@ -350,11 +350,13 @@ suite() ->
escalus:suite().

init_per_suite(Config) ->
muc_helper:load_muc(muc_host()),
disable_shaping(
delete_users([{escalus_user_db, {module, escalus_ejabberd}}
| escalus:init_per_suite(Config)])).

end_per_suite(Config) ->
muc_helper:unload_muc(),
escalus:end_per_suite(restore_shaping(Config)).

user_names() ->
Expand Down
3 changes: 3 additions & 0 deletions test/ejabberd_tests/tests/muc_SUITE.erl
Expand Up @@ -211,11 +211,14 @@ suite() ->
%% Init & teardown
%%--------------------------------------------------------------------


init_per_suite(Config) ->
muc_helper:load_muc(?MUC_HOST),
escalus:init_per_suite(Config).

end_per_suite(Config) ->
escalus_fresh:clean(),
muc_helper:unload_muc(),
escalus:end_per_suite(Config).

init_per_group(moderator, Config) ->
Expand Down
17 changes: 16 additions & 1 deletion test/ejabberd_tests/tests/muc_helper.erl
Expand Up @@ -3,7 +3,9 @@
-include_lib("exml/include/exml.hrl").

-export([foreach_occupant/3,
foreach_recipient/2]).
foreach_recipient/2,
load_muc/1,
unload_muc/0]).

-type verify_fun() :: fun((Incoming :: #xmlel{}) -> any()).

Expand Down Expand Up @@ -37,3 +39,16 @@ foreach_recipient(Users, VerifyFun) ->
fun(Recipient) ->
VerifyFun(escalus:wait_for_stanza(Recipient))
end, Users).

load_muc(Host) ->
dynamic_modules:start(<<"localhost">>, mod_muc,
[{host, binary_to_list(Host)},
{access, muc},
{access_create, muc_create}]),
dynamic_modules:start(<<"localhost">>, mod_muc_log,
[{outdir, "/tmp/muclogs"},
{access_log, muc}]).

unload_muc() ->
dynamic_modules:stop(<<"localhost">>, mod_muc),
dynamic_modules:stop(<<"localhost">>, mod_muc_log).