diff --git a/big_tests/tests/gdpr_SUITE.erl b/big_tests/tests/gdpr_SUITE.erl index 3cd8509b6dc..3a1d42e911f 100644 --- a/big_tests/tests/gdpr_SUITE.erl +++ b/big_tests/tests/gdpr_SUITE.erl @@ -77,6 +77,8 @@ all() -> ]. groups() -> + %% **DON'T** make any of these groups parallel, because calling mongooseimctl + %% in parallel is broken! [ {retrieve_personal_data, [], [ retrieve_vcard, @@ -174,7 +176,7 @@ init_per_suite(Config) -> #{node := MimNode} = distributed_helper:mim(), Config1 = [{{ejabberd_cwd, MimNode}, get_mim_cwd()} | dynamic_modules:save_modules(host_type(), Config)], muc_helper:load_muc(), - Config2 = graphql_helper:init_admin_handler(Config1), + Config2 = graphql_helper:init_admin_cli(Config1), escalus:init_per_suite(Config2). end_per_suite(Config) -> @@ -1521,14 +1523,15 @@ retrieve_inbox_for_multiple_messages(Config) -> retrieve_logs(Config) -> escalus:fresh_story(Config, [{alice, 1}], fun(Alice) -> - User = escalus_client:username(Alice), - Domain = escalus_client:server(Alice), + User = string:to_lower(binary_to_list(escalus_client:username(Alice))), + Domain = string:to_lower(binary_to_list(escalus_client:server(Alice))), JID = string:to_upper(binary_to_list(escalus_client:short_jid(Alice))), #{node := MIM2NodeName} = MIM2Node = distributed_helper:mim2(), mongoose_helper:successful_rpc(net_kernel, connect_node, [MIM2NodeName]), mongoose_helper:successful_rpc(MIM2Node, error_logger, error_msg, ["event=disturbance_in_the_force, jid=~s", [JID]]), - Dir = request_and_unzip_personal_data(User, Domain, Config), + Dir = request_and_unzip_personal_data(list_to_binary(User), list_to_binary(Domain), + Config), Filename = filename:join(Dir, "logs-" ++ atom_to_list(MIM2NodeName) ++ ".txt"), {ok, Content} = file:read_file(Filename), {match, _} = re:run(Content, "disturbance_in_the_force") diff --git a/big_tests/tests/metrics_roster_SUITE.erl b/big_tests/tests/metrics_roster_SUITE.erl index c2502a09500..36c6374df2e 100644 --- a/big_tests/tests/metrics_roster_SUITE.erl +++ b/big_tests/tests/metrics_roster_SUITE.erl @@ -72,6 +72,7 @@ init_per_suite(Config) -> [{mongoose_metrics, MongooseMetrics} | escalus:init_per_suite(Config)]. end_per_suite(Config) -> + escalus_fresh:clean(), escalus:end_per_suite(Config). init_per_group(_GroupName, Config) -> diff --git a/big_tests/tests/mongooseimctl_SUITE.erl b/big_tests/tests/mongooseimctl_SUITE.erl new file mode 100644 index 00000000000..76b0d296b4a --- /dev/null +++ b/big_tests/tests/mongooseimctl_SUITE.erl @@ -0,0 +1,230 @@ +%%============================================================================== +%% Copyright 2013 Erlang Solutions Ltd. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%============================================================================== +-module(mongooseimctl_SUITE). +-compile([export_all, nowarn_export_all, nowarn_shadow_vars]). +-include_lib("escalus/include/escalus.hrl"). +-include_lib("common_test/include/ct.hrl"). +-include_lib("exml/include/exml.hrl"). +-include_lib("eunit/include/eunit.hrl"). + +-import(mongooseimctl_helper, [mongooseimctl/3]). +-import(distributed_helper, [mim/0, require_rpc_nodes/1]). +-import(domain_helper, [domain/0]). + +%%-------------------------------------------------------------------- +%% Suite configuration +%%-------------------------------------------------------------------- + +all() -> + [ + {group, graphql}, + {group, help}, + {group, server} + ]. + +groups() -> + [{graphql, [], graphql()}, + {help, [], help()}, + {server, [], server()}]. + +graphql() -> + [graphql_wrong_arguments_number, + can_execute_admin_queries_with_permissions, + can_handle_execution_error, + graphql_error_unknown_command_with_args, + graphql_error_unknown_command_without_args, + graphql_error_unknown_category_with_args, + graphql_error_unknown_category_without_args, + graphql_no_command, + graphql_error_invalid_args, + graphql_error_invalid_arg_value, + graphql_error_no_arg_value, + graphql_error_missing_args, + graphql_error_unknown_arg, + graphql_arg_help, + graphql_command]. + +help() -> + [default_help, + help_with_dual_mode, + help_with_long_mode]. + +server() -> + [server_status, + server_is_started]. + +suite() -> + require_rpc_nodes([mim]) ++ escalus:suite(). + +init_per_suite(Config) -> + Node = mim(), + Config1 = ejabberd_node_utils:init(Node, Config), + Config1. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(CaseName, Config) -> + escalus:init_per_testcase(CaseName, Config). + +end_per_testcase(CaseName, Config) -> + escalus:end_per_testcase(CaseName, Config). + +%%-------------------------------------------------------------------- +%% mongoose_graphql tests +%%-------------------------------------------------------------------- + +can_execute_admin_queries_with_permissions(Config) -> + Query = "query { checkAuth { authStatus } }", + Res = mongooseimctl("graphql", [Query], Config), + ?assertMatch({_, 0}, Res), + Data = element(1, Res), + ?assertNotEqual(nomatch, string:find(Data, "AUTHORIZED")). + +can_handle_execution_error(Config) -> + Query = "{}", + Res = mongooseimctl("graphql", [Query], Config), + ?assertMatch({_, 1}, Res), + Data = element(1, Res), + ?assertNotEqual(nomatch, string:find(Data, "parser_error")). + +graphql_wrong_arguments_number(Config) -> + ExpectedFragment = "This command requires", + ResNoArgs = mongooseimctl("graphql", [], Config), + ?assertMatch({_, 1}, ResNoArgs), + Data1 = element(1, ResNoArgs), + ?assertNotEqual(nomatch, string:find(Data1, ExpectedFragment)), + + ResTooManyArgs = mongooseimctl("graphql", ["{}", "{}"], Config), + ?assertMatch({_, 1}, ResTooManyArgs), + Data2 = element(1, ResTooManyArgs), + ?assertNotEqual(nomatch, string:find(Data2, ExpectedFragment)). + +%% Generic GraphQL command tests +%% Specific commands are tested in graphql_*_SUITE + +graphql_error_unknown_command_with_args(Config) -> + {Res, 1} = mongooseimctl("account", ["makeCoffee", "--strength", "medium"], Config), + ?assertMatch({match, _}, re:run(Res, "Unknown command")), + expect_existing_commands(Res). + +graphql_error_unknown_command_without_args(Config) -> + {Res, 1} = mongooseimctl("account", ["makeCoffee"], Config), + ?assertMatch({match, _}, re:run(Res, "Unknown command")), + expect_existing_commands(Res). + +graphql_error_unknown_category_with_args(Config) -> + {Res, 1} = mongooseimctl("cafe", ["makeCoffee"], Config), + ?assertMatch({match, _}, re:run(Res, "Unknown category")), + expect_category_list(Res). + +graphql_error_unknown_category_without_args(Config) -> + {Res, 1} = mongooseimctl("cafe", [], Config), + ?assertMatch({match, _}, re:run(Res, "Unknown category")), + expect_category_list(Res). + +graphql_no_command(Config) -> + %% Not an error - lists commands in the given category + {Res, 0} = mongooseimctl("account", [], Config), + expect_existing_commands(Res). + +graphql_error_invalid_args(Config) -> + {Res, 1} = mongooseimctl("account", ["countUsers", "now"], Config), + ?assertMatch({match, _}, re:run(Res, "Could not parse")), + expect_command_arguments(Res). + +graphql_error_invalid_arg_value(Config) -> + {Res, 1} = mongooseimctl("vcard", ["setVcard", "--user", "user@host", "--vcard", "x"], Config), + %% vCard should be provided in JSON + ?assertMatch({match, _}, re:run(Res, "Invalid value 'x' of argument 'vcard'")), + ?assertMatch({match, _}, re:run(Res, "vcard\s+VcardInput!")). + +graphql_error_no_arg_value(Config) -> + {Res, 1} = mongooseimctl("account", ["countUsers", "--domain"], Config), + ?assertMatch({match, _}, re:run(Res, "Could not parse")), + expect_command_arguments(Res). + +graphql_error_missing_args(Config) -> + {Res, 1} = mongooseimctl("account", ["countUsers"], Config), + ?assertMatch({match, _}, re:run(Res, "Missing mandatory arguments")), + expect_command_arguments(Res). + +graphql_error_unknown_arg(Config) -> + {Res, 1} = mongooseimctl("account", ["countUsers", "--domain", "localhost", + "--x", "y"], Config), + ?assertMatch({match, _}, re:run(Res, "Unknown argument")), + expect_command_arguments(Res). + +graphql_arg_help(Config) -> + {Res, 0} = mongooseimctl("account", ["countUsers", "--help"], Config), + expect_command_arguments(Res). + +graphql_command(Config) -> + {ResJSON, 0} = mongooseimctl("account", ["countUsers", "--domain", "localhost"], Config), + #{<<"data">> := Data} = rest_helper:decode(ResJSON, #{return_maps => true}), + ?assertMatch(#{<<"account">> := #{<<"countUsers">> := _}}, Data). + +expect_existing_commands(Res) -> + ?assertMatch({match, _}, re:run(Res, "countUsers")). + +expect_command_arguments(Res) -> + ?assertMatch({match, _}, re:run(Res, "domain\s+DomainName!")). + +%%----------------------------------------------------------------- +%% Help tests +%%----------------------------------------------------------------- + +default_help(Config) -> + #{node := Node} = mim(), + CtlCmd = distributed_helper:ctl_path(Node, Config), + {Res, 2} = mongooseimctl_helper:run(CtlCmd, []), + expect_category_list(Res). + +help_with_dual_mode(Config) -> + {Res1, 2} = mongooseimctl("help", ["--dual"], Config), + expect_category_list(Res1), + {Res2, 2} = mongooseimctl("help", ["--nonexistent"], Config), + expect_category_list(Res2), + {Res3, 2} = mongooseimctl("help", [], Config), + expect_category_list(Res3). + +help_with_long_mode(Config) -> + {Res, 2} = mongooseimctl("help", ["--long"], Config), + io:format("Res: ~p", [Res]), + ?assertMatch({match, _}, re:run(Res, "Usage")), + ?assertMatch({match, _}, re:run(Res, "account \n\s+Account management")). + +%%----------------------------------------------------------------- +%% Server management tests +%%----------------------------------------------------------------- + +server_status(Config) -> + {Res, 0} = mongooseimctl("status", [], Config), + ?assertMatch({match, _}, re:run(Res, "Erlang VM status: started")). + +server_is_started(Config) -> + %% Wait for the server to start, but it is already running + {Res, 0} = mongooseimctl("started", [], Config), + %% Expect only whitespace + ?assertMatch(nomatch, re:run(Res, "\S")). + +%%----------------------------------------------------------------- +%% Helpers +%%----------------------------------------------------------------- + +expect_category_list(Res) -> + ?assertMatch({match, _}, re:run(Res, "Usage")), + ?assertMatch({match, _}, re:run(Res, "account\s+Account management")). diff --git a/src/config/mongoose_config_spec.erl b/src/config/mongoose_config_spec.erl index b5bf02dd4b3..53279d9a448 100644 --- a/src/config/mongoose_config_spec.erl +++ b/src/config/mongoose_config_spec.erl @@ -189,9 +189,6 @@ general() -> <<"route_subdomains">> => #option{type = atom, validate = {enum, [s2s]}, wrap = host_config}, - <<"mongooseimctl_access_commands">> => #section{ - items = #{default => ctl_access_rule()}, - wrap = global_config}, <<"routing_modules">> => #list{items = #option{type = atom, validate = module}, process = fun xmpp_router:expand_routing_modules/1, @@ -220,22 +217,10 @@ general_defaults() -> <<"component_backend">> => mnesia, <<"s2s_backend">> => mnesia, <<"rdbms_server_type">> => generic, - <<"mongooseimctl_access_commands">> => #{}, <<"routing_modules">> => mongoose_router:default_routing_modules(), <<"replaced_wait_timeout">> => 2000, <<"hide_service_name">> => false}. -ctl_access_rule() -> - #section{ - items = #{<<"commands">> => #list{items = #option{type = atom, - validate = non_empty}}, - <<"argument_restrictions">> => - #section{items = #{default => #option{type = string}}} - }, - defaults = #{<<"commands">> => all, - <<"argument_restrictions">> => #{}} - }. - %% path: general.domain_certfile domain_cert() -> #section{ diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl index eec2e35e103..ea310cafe30 100644 --- a/src/ejabberd_admin.erl +++ b/src/ejabberd_admin.erl @@ -26,8 +26,7 @@ -module(ejabberd_admin). -author('mickael.remond@process-one.net'). --export([start/0, stop/0, - %% Server +-export([%% Server status/0, %% Accounts register/3, register/2, unregister/2, @@ -48,12 +47,6 @@ -include("mongoose.hrl"). -start() -> - ok. - -stop() -> - ok. - %%% %%% Commands %%% diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl index 88936128b33..78d84bb1d58 100644 --- a/src/ejabberd_app.erl +++ b/src/ejabberd_app.erl @@ -77,7 +77,6 @@ do_start() -> mongoose_modules:start(), service_mongoose_system_metrics:verify_if_configured(), mongoose_listener:start(), - ejabberd_admin:start(), mongoose_metrics:init_mongooseim_metrics(), gen_hook:reload_hooks(), update_status_file(started), diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index d4accc58025..35290146139 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -39,8 +39,6 @@ %%% TODO: Update the guide %%% TODO: Mention this in the release notes %%% Note: the commands with several words use now the underline: _ -%%% It is still possible to call the commands with dash: - -%%% but this is deprecated, and may be removed in a future version. -module(ejabberd_ctl). @@ -154,7 +152,7 @@ process(["help" | Mode]) -> ?STATUS_USAGE; [_] -> print_usage(dual, MaxC, ShCode), - ?STATUS_SUCCESS + ?STATUS_USAGE end; process(Args) -> case mongoose_graphql_commands:process(Args) of @@ -162,7 +160,7 @@ process(Args) -> handle_graphql_result(Result); #{status := error, reason := no_args} = Ctx -> print_usage(Ctx), - ?STATUS_ERROR; + ?STATUS_USAGE; #{status := error} = Ctx -> ?PRINT(error_message(Ctx) ++ "\n\n", []), print_usage(Ctx), @@ -184,8 +182,6 @@ error_message(#{reason := {unknown_arg, ArgName}, command := Command}) -> error_message(#{reason := {invalid_arg_value, ArgName, ArgValue}, command := Command}) -> io_lib:format("Invalid value '~s' of argument '~s' for command '~s'", [ArgValue, ArgName, Command]); -error_message(#{reason := no_args, command := Command}) -> - io_lib:format("No arguments provided for command '~s'", [Command]); error_message(#{reason := {missing_args, MissingArgs}, command := Command}) -> io_lib:format("Missing mandatory arguments for command '~s': ~s", [Command, ["'", lists:join("', '", MissingArgs), "'"]]). diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 8fb34453013..15a46c41f8e 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -77,7 +77,10 @@ -ignore_xref([get_user_rosters_length/2, item_to_xml/1, process_subscription_t/6, - transaction/2]). + transaction/2, + broadcast_item/3, + set_items/3 + ]). -include("mongoose.hrl"). -include("jlib.hrl"). diff --git a/src/mongoose_account_api.erl b/src/mongoose_account_api.erl index ec36e2df17f..be1cbfd139f 100644 --- a/src/mongoose_account_api.erl +++ b/src/mongoose_account_api.erl @@ -19,6 +19,11 @@ check_password_hash/4, import_users/1]). +-ignore_xref([ban_account/3, + check_account/2, + check_password/3, + check_password_hash/4]). + -type register_result() :: {ok | exists | invalid_jid | cannot_register | limit_per_domain_exceeded, iolist()}. diff --git a/src/mongoose_bin.erl b/src/mongoose_bin.erl index db832e55659..984d1f0713b 100644 --- a/src/mongoose_bin.erl +++ b/src/mongoose_bin.erl @@ -12,8 +12,7 @@ join/2, encode_crypto/1, gen_from_crypto/0, - gen_from_timestamp/0, - string_to_binary/1]). + gen_from_timestamp/0]). %% --------------------------------------------------- %% API @@ -47,20 +46,6 @@ gen_from_timestamp() -> -spec encode_crypto(iodata()) -> binary(). encode_crypto(Text) -> base16:encode(crypto:hash(sha, Text)). --spec string_to_binary(binary() | list()) -> binary(). -string_to_binary(S) when is_list(S) -> - % If list is in Erlang representation of Unicode, we must use `unicode` module - % If it's not or is already converted, we must use list_to_binary - % since input can be from `file:consult/1` and prior to 17.0 - % this function returned bytes in a list instead of proper unicode string - % so it is already like after a call to `unicode`. - case lists:any(fun(C) -> C > 255 end, S) of - true -> unicode:characters_to_binary(S); - false -> list_to_binary(S) - end; -string_to_binary(B) when is_binary(B) -> - B. - %% --------------------------------------------------- %% Internal functions %% --------------------------------------------------- diff --git a/test/auth_tokens_SUITE.erl b/test/auth_tokens_SUITE.erl index 15c0d03af61..98ba07a62aa 100644 --- a/test/auth_tokens_SUITE.erl +++ b/test/auth_tokens_SUITE.erl @@ -65,7 +65,6 @@ init_per_testcase(validity_period_test, Config) -> mock_rdbms_backend(), mock_mongoose_metrics(), mock_gen_iq_handler(), - mock_ejabberd_commands(), async_helper:start(Config, [{mongooseim_helper, start_link_loaded_hooks, []}]); init_per_testcase(revoked_token_is_not_valid, Config) -> @@ -91,7 +90,6 @@ end_per_testcase(validity_period_test, C) -> meck:unload(mod_auth_token_backend), meck:unload(mongoose_metrics), meck:unload(gen_iq_handler), - meck:unload(ejabberd_commands), async_helper:stop_all(C), C; @@ -254,10 +252,6 @@ mock_tested_backend() -> receive {valid_seq_no, SeqNo} -> SeqNo end end). -mock_ejabberd_commands() -> - meck:new(ejabberd_commands, []), - meck:expect(ejabberd_commands, register_commands, fun (_) -> ok end). - provision_token_example() -> {token,provision, {{2055,10,27},{10,54,22}}, diff --git a/test/common/config_parser_helper.erl b/test/common/config_parser_helper.erl index c585018de78..2201d7c9661 100644 --- a/test/common/config_parser_helper.erl +++ b/test/common/config_parser_helper.erl @@ -18,7 +18,6 @@ options("host_types") -> {language, <<"en">>}, {listen, []}, {loglevel, warning}, - {mongooseimctl_access_commands, #{}}, {outgoing_pools, []}, {rdbms_server_type, generic}, {registration_timeout, 600}, @@ -80,9 +79,6 @@ options("miscellaneous") -> transport => #{num_acceptors => 10, max_connections => 1024} })]}, {loglevel, warning}, - {mongooseimctl_access_commands, - #{local => #{commands => [join_cluster], - argument_restrictions => #{node => "mongooseim@prime"}}}}, {outgoing_pools, []}, {rdbms_server_type, mssql}, {registration_timeout, 600}, @@ -119,7 +115,6 @@ options("modules") -> {language, <<"en">>}, {listen, []}, {loglevel, warning}, - {mongooseimctl_access_commands, #{}}, {outgoing_pools, []}, {rdbms_server_type, generic}, {registration_timeout, 600}, @@ -240,7 +235,6 @@ options("mongooseim-pgsql") -> ]}, {loglevel, warning}, {max_fsm_queue, 1000}, - {mongooseimctl_access_commands, #{}}, {outgoing_pools, lists:map( fun pool_config/1, @@ -260,10 +254,7 @@ options("mongooseim-pgsql") -> {registration_timeout, infinity}, {routing_modules, mongoose_router:default_routing_modules()}, {services, - #{service_admin_extra => - #{submods => [node, accounts, sessions, vcard, gdpr, upload, - roster, last, private, stanza, stats]}, - service_mongoose_system_metrics => + #{service_mongoose_system_metrics => #{initial_report => 300000, periodic_report => 10800000}}}, {sm_backend, mnesia}, @@ -322,7 +313,6 @@ options("outgoing_pools") -> {language, <<"en">>}, {listen, []}, {loglevel, warning}, - {mongooseimctl_access_commands, #{}}, {outgoing_pools, lists:map( fun pool_config/1, @@ -386,7 +376,6 @@ options("s2s_only") -> {language, <<"en">>}, {listen, []}, {loglevel, warning}, - {mongooseimctl_access_commands, #{}}, {outgoing_pools, []}, {rdbms_server_type, generic}, {registration_timeout, 600}, @@ -1071,8 +1060,6 @@ extra_service_listener_config() -> conflict_behaviour => disconnect, connection_type => component}. -default_config([general, mongooseimctl_access_commands, _Key]) -> - #{commands => all, argument_restrictions => #{}}; default_config([listen, http]) -> (common_listener_config())#{module => ejabberd_cowboy, transport => default_config([listen, http, transport]), @@ -1258,9 +1245,6 @@ default_config([outgoing_pools, _Type, _Tag, conn_opts, tls] = P) -> server_name_indication => default_config(P ++ [server_name_indication])}; default_config([outgoing_pools, _Type, _Tag, conn_opts, tls, server_name_indication]) -> #{enabled => true, protocol => default}; -default_config([services, service_admin_extra]) -> - #{submods => [node, accounts, sessions, vcard, roster, last, - private, stanza, stats, gdpr, upload, domain]}; default_config([services, service_domain_db]) -> #{event_cleaning_interval => 1800, event_max_age => 7200, diff --git a/test/config_parser_SUITE.erl b/test/config_parser_SUITE.erl index 9b6935c543f..74240f8a5cd 100644 --- a/test/config_parser_SUITE.erl +++ b/test/config_parser_SUITE.erl @@ -81,7 +81,6 @@ groups() -> http_server_name, rdbms_server_type, route_subdomains, - mongooseimctl_access_commands, routing_modules, replaced_wait_timeout, hide_service_name, @@ -230,8 +229,7 @@ groups() -> mod_version, modules_without_config, incorrect_module]}, - {services, [parallel], [service_admin_extra, - service_domain_db, + {services, [parallel], [service_domain_db, service_mongoose_system_metrics]} ]. @@ -417,19 +415,6 @@ route_subdomains(_Config) -> ?cfgh(route_subdomains, s2s, #{<<"general">> => #{<<"route_subdomains">> => <<"s2s">>}}), ?errh(#{<<"general">> => #{<<"route_subdomains">> => <<"c2s">>}}). -mongooseimctl_access_commands(_Config) -> - ?cfg(mongooseimctl_access_commands, #{}, #{}), % default - P = [mongooseimctl_access_commands, local], - T = fun(Opts) -> - #{<<"general">> => #{<<"mongooseimctl_access_commands">> => #{<<"local">> => Opts}}} - end, - ?cfg(P, default_config([general, mongooseimctl_access_commands, local]), T(#{})), - ?cfg(P ++ [commands], [join_cluster], T(#{<<"commands">> => [<<"join_cluster">>]})), - ?cfg(P ++ [argument_restrictions], #{node => "mim1@host1"}, - T(#{<<"argument_restrictions">> => #{<<"node">> => <<"mim1@host1">>}})), - ?err(T(#{<<"commands">> => [<<>>]})), - ?err(T(#{<<"argument_restrictions">> => #{<<"node">> => 1}})). - routing_modules(_Config) -> ?cfg(routing_modules, mongoose_router:default_routing_modules(), #{}), % default ?cfg(routing_modules, @@ -2857,15 +2842,6 @@ incorrect_module(_Config) -> %% Services -service_admin_extra(_Config) -> - P = [services, service_admin_extra], - T = fun(Opts) -> #{<<"services">> => #{<<"service_admin_extra">> => Opts}} end, - ?cfg(P, default_config(P), T(#{})), - ?cfg(P ++ [submods], [node], T(#{<<"submods">> => [<<"node">>]})), - ?err(T(#{<<"submods">> => 1})), - ?err(T(#{<<"submods">> => [1]})), - ?err(T(#{<<"submods">> => [<<"nodejshaha">>]})). - service_domain_db(_Config) -> P = [services, service_domain_db], T = fun(Opts) -> #{<<"services">> => #{<<"service_domain_db">> => Opts}} end, diff --git a/test/config_parser_SUITE_data/miscellaneous.toml b/test/config_parser_SUITE_data/miscellaneous.toml index e423e6b2d27..6ff3da56a3b 100644 --- a/test/config_parser_SUITE_data/miscellaneous.toml +++ b/test/config_parser_SUITE_data/miscellaneous.toml @@ -14,10 +14,6 @@ replaced_wait_timeout = 2000 hide_service_name = true - [general.mongooseimctl_access_commands.local] - commands = ["join_cluster"] - argument_restrictions.node = "mongooseim@prime" - [[general.domain_certfile]] domain = "example.com" certfile = "priv/cert.pem" diff --git a/test/ejabberd_sm_SUITE.erl b/test/ejabberd_sm_SUITE.erl index 38d4a72caf4..f8f38866074 100644 --- a/test/ejabberd_sm_SUITE.erl +++ b/test/ejabberd_sm_SUITE.erl @@ -400,7 +400,6 @@ unique_count_while_removing_entries(C) -> unload_meck() -> meck:unload(acl), meck:unload(gen_hook), - meck:unload(ejabberd_commands), meck:unload(mongoose_domain_api), catch ets:delete(test_c2s_info), catch meck:unload(mongoose_c2s). @@ -647,7 +646,4 @@ sm_backend(ejabberd_sm_cets) -> cets. set_meck() -> meck:expect(gen_hook, add_handler, fun(_, _, _, _, _) -> ok end), meck:expect(gen_hook, add_handlers, fun(_) -> ok end), - meck:new(ejabberd_commands, []), - meck:expect(ejabberd_commands, register_commands, fun(_) -> ok end), - meck:expect(ejabberd_commands, unregister_commands, fun(_) -> ok end), ok. diff --git a/test/mongoose_cleanup_SUITE.erl b/test/mongoose_cleanup_SUITE.erl index f41a3e83548..72822d01a1f 100644 --- a/test/mongoose_cleanup_SUITE.erl +++ b/test/mongoose_cleanup_SUITE.erl @@ -125,7 +125,7 @@ opts() -> {modules, ?HOST} => #{}}. meck_mods(bosh) -> [exometer, mod_bosh_socket]; -meck_mods(s2s) -> [exometer, ejabberd_commands, mongoose_bin]; +meck_mods(s2s) -> [exometer, mongoose_bin]; meck_mods(component) -> [exometer]; meck_mods(_) -> [exometer, ejabberd_sm, ejabberd_local]. @@ -298,10 +298,6 @@ setup_meck([ejabberd_local | R]) -> meck:expect(ejabberd_local, register_iq_handler, fun(_A1, _A2, _A3) -> ok end), setup_meck(R); -setup_meck([ejabberd_commands | R]) -> - meck:new(ejabberd_commands), - meck:expect(ejabberd_commands, register_commands, fun(_) -> ok end), - setup_meck(R); setup_meck([mongoose_bin | R]) -> meck:new(mongoose_bin, [passthrough]), meck:expect(mongoose_bin, gen_from_crypto, fun() -> <<"123456">> end), diff --git a/test/mongoose_config_SUITE.erl b/test/mongoose_config_SUITE.erl index 50ebd37e482..c2783954df7 100644 --- a/test/mongoose_config_SUITE.erl +++ b/test/mongoose_config_SUITE.erl @@ -175,7 +175,6 @@ minimal_config_opts() -> language => <<"en">>, listen => [], loglevel => warning, - mongooseimctl_access_commands => #{}, outgoing_pools => [], rdbms_server_type => generic, registration_timeout => 600, diff --git a/tools/pkg/scripts/smoke_test.sh b/tools/pkg/scripts/smoke_test.sh index 6fb1c6b5e8a..fba996dc022 100755 --- a/tools/pkg/scripts/smoke_test.sh +++ b/tools/pkg/scripts/smoke_test.sh @@ -83,3 +83,4 @@ fi echo "Stopping mongooseim via 'mongooseimctl stop'" mongooseimctl stop +