Fixing some tests
This commit is contained in:
parent
e1e79f6e46
commit
fe3e83ec50
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
defmodule RabbitMQ.CLI.Ctl.Commands.ForceResetCommand do
|
defmodule RabbitMQ.CLI.Ctl.Commands.ForceResetCommand do
|
||||||
@behaviour RabbitMQ.CLI.CommandBehaviour
|
@behaviour RabbitMQ.CLI.CommandBehaviour
|
||||||
use RabbitMQ.CLI.DefaultOutput
|
|
||||||
@flags []
|
@flags []
|
||||||
|
|
||||||
def merge_defaults(args, opts), do: {args, opts}
|
def merge_defaults(args, opts), do: {args, opts}
|
||||||
|
|
@ -40,4 +39,5 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ForceResetCommand do
|
||||||
{:error, RabbitMQ.CLI.ExitCodes.exit_software,
|
{:error, RabbitMQ.CLI.ExitCodes.exit_software,
|
||||||
RabbitMQ.CLI.DefaultOutput.mnesia_running_error(node_name)}
|
RabbitMQ.CLI.DefaultOutput.mnesia_running_error(node_name)}
|
||||||
end
|
end
|
||||||
|
use RabbitMQ.CLI.DefaultOutput
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ defmodule ListPoliciesCommandTest do
|
||||||
|
|
||||||
add_vhost @vhost
|
add_vhost @vhost
|
||||||
|
|
||||||
|
enable_federation_plugin()
|
||||||
|
|
||||||
on_exit(fn ->
|
on_exit(fn ->
|
||||||
delete_vhost @vhost
|
delete_vhost @vhost
|
||||||
:erlang.disconnect_node(get_rabbit_hostname)
|
:erlang.disconnect_node(get_rabbit_hostname)
|
||||||
|
|
@ -44,6 +46,32 @@ defmodule ListPoliciesCommandTest do
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def enable_federation_plugin() do
|
||||||
|
node = get_rabbit_hostname
|
||||||
|
|
||||||
|
{:ok, plugins_file} = :rabbit_misc.rpc_call(node,
|
||||||
|
:application, :get_env,
|
||||||
|
[:rabbit, :enabled_plugins_file])
|
||||||
|
{:ok, plugins_dir} = :rabbit_misc.rpc_call(node,
|
||||||
|
:application, :get_env,
|
||||||
|
[:rabbit, :plugins_dir])
|
||||||
|
{:ok, rabbitmq_home} = :rabbit_misc.rpc_call(node, :file, :get_cwd, [])
|
||||||
|
|
||||||
|
{:ok, [enabled_plugins]} = :file.consult(plugins_file)
|
||||||
|
|
||||||
|
opts = %{enabled_plugins_file: plugins_file,
|
||||||
|
plugins_dir: plugins_dir,
|
||||||
|
rabbitmq_home: rabbitmq_home,
|
||||||
|
online: true, offline: false}
|
||||||
|
|
||||||
|
plugins = currently_active_plugins(%{opts: %{node: node}})
|
||||||
|
case Enum.member?(plugins, :rabbitmq_federation) do
|
||||||
|
true -> :ok
|
||||||
|
false ->
|
||||||
|
set_enabled_plugins(get_rabbit_hostname, plugins ++ [:rabbitmq_federation], opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
setup context do
|
setup context do
|
||||||
|
|
||||||
on_exit(fn ->
|
on_exit(fn ->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue