Merge branch 'stable'
This commit is contained in:
commit
fb91ddd0ca
|
|
@ -1250,21 +1250,25 @@ clear_global_parameter(Config, Node, Name) ->
|
|||
%% -------------------------------------------------------------------
|
||||
|
||||
enable_plugin(Config, Node, Plugin) ->
|
||||
plugin_action(Config, Node, enable, [Plugin], []).
|
||||
plugin_action(Config, Node, [enable, Plugin]).
|
||||
|
||||
disable_plugin(Config, Node, Plugin) ->
|
||||
plugin_action(Config, Node, disable, [Plugin], []).
|
||||
plugin_action(Config, Node, [disable, Plugin]).
|
||||
|
||||
plugin_action(Config, Node, Command, Args, Opts) ->
|
||||
PluginsFile = rabbit_ct_broker_helpers:get_node_config(Config, Node,
|
||||
enabled_plugins_file),
|
||||
PluginsDir = rabbit_ct_broker_helpers:get_node_config(Config, Node,
|
||||
plugins_dir),
|
||||
Nodename = rabbit_ct_broker_helpers:get_node_config(Config, Node,
|
||||
nodename),
|
||||
rabbit_ct_broker_helpers:rpc(Config, Node,
|
||||
rabbit_plugins_main, action,
|
||||
[Command, Nodename, Args, Opts, PluginsFile, PluginsDir]).
|
||||
plugin_action(Config, Node, Args) ->
|
||||
Rabbitmqplugins = ?config(rabbitmq_plugins_cmd, Config),
|
||||
NodeConfig = get_node_config(Config, Node),
|
||||
Nodename = ?config(nodename, NodeConfig),
|
||||
Env = [
|
||||
{"RABBITMQ_PID_FILE", ?config(pid_file, NodeConfig)},
|
||||
{"RABBITMQ_MNESIA_DIR", ?config(mnesia_dir, NodeConfig)},
|
||||
{"RABBITMQ_PLUGINS_DIR", ?config(plugins_dir, NodeConfig)},
|
||||
{"RABBITMQ_ENABLED_PLUGINS_FILE",
|
||||
?config(enabled_plugins_file, NodeConfig)}
|
||||
],
|
||||
Cmd = [Rabbitmqplugins, "-n", Nodename | Args],
|
||||
{ok, _} = rabbit_ct_helpers:exec(Cmd, [{env, Env}]),
|
||||
ok.
|
||||
|
||||
%% -------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ run_setup_steps(Config, ExtraSteps) ->
|
|||
fun ensure_erl_call_cmd/1,
|
||||
fun ensure_rabbitmqctl_cmd/1,
|
||||
fun ensure_rabbitmqctl_app/1,
|
||||
fun ensure_rabbitmq_plugins_cmd/1,
|
||||
fun ensure_ssl_certs/1,
|
||||
fun start_long_running_testsuite_monitor/1
|
||||
],
|
||||
|
|
@ -301,6 +302,38 @@ ensure_rabbitmqctl_app(Config) ->
|
|||
"please build rabbitmq_cli and set MIX_ENV"}
|
||||
end.
|
||||
|
||||
ensure_rabbitmq_plugins_cmd(Config) ->
|
||||
Rabbitmqplugins = case get_config(Config, rabbitmq_plugins_cmd) of
|
||||
undefined ->
|
||||
case os:getenv("RABBITMQ_PLUGINS") of
|
||||
false ->
|
||||
SrcDir = ?config(rabbit_srcdir, Config),
|
||||
R = filename:join(SrcDir, "scripts/rabbitmq-plugins"),
|
||||
case filelib:is_file(R) of
|
||||
true -> R;
|
||||
false -> false
|
||||
end;
|
||||
R ->
|
||||
R
|
||||
end;
|
||||
R ->
|
||||
R
|
||||
end,
|
||||
Error = {skip, "rabbitmq_plugins required, " ++
|
||||
"please set RABBITMQ_PLUGINS or 'rabbitmq_plugins_cmd' in ct config"},
|
||||
case Rabbitmqplugins of
|
||||
false ->
|
||||
Error;
|
||||
_ ->
|
||||
Cmd = [Rabbitmqplugins],
|
||||
case exec(Cmd, [drop_stdout]) of
|
||||
{error, 64, _} ->
|
||||
set_config(Config, {rabbitmq_plugins_cmd, Rabbitmqplugins});
|
||||
_ ->
|
||||
Error
|
||||
end
|
||||
end.
|
||||
|
||||
ensure_ssl_certs(Config) ->
|
||||
SrcDir = ?config(rabbitmq_ct_helpers_srcdir, Config),
|
||||
CertsMakeDir = filename:join([SrcDir, "tools", "tls-certs"]),
|
||||
|
|
|
|||
Loading…
Reference in New Issue