rabbitmq_cli: Adapt `force_reset_command_test.exs` testsuites

[Why]
`force_reset` is unsupported with Khepri.
This commit is contained in:
Jean-Sébastien Pédron 2025-04-09 15:16:16 +02:00
parent 0541996b30
commit a34ce08f8f
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
1 changed files with 18 additions and 9 deletions

View File

@ -31,6 +31,14 @@ defmodule ForceResetCommandTest do
end
test "run: force reset request to an active node with a stopped rabbit app succeeds", context do
node = get_rabbit_hostname()
case :rabbit_misc.rpc_call(node, :rabbit_khepri, :is_enabled, []) do
true ->
stop_rabbitmq_app()
assert {:error, ~c"Forced reset is unsupported with Khepri"} == @command.run([], context[:opts])
start_rabbitmq_app()
false ->
add_vhost("some_vhost")
# ensure the vhost really does exist
assert vhost_exists?("some_vhost")
@ -40,6 +48,7 @@ defmodule ForceResetCommandTest do
# check that the created vhost no longer exists
assert match?([_], list_vhosts())
end
end
test "run: reset request to an active node with a running rabbit app fails", context do
add_vhost("some_vhost")
@ -49,7 +58,7 @@ defmodule ForceResetCommandTest do
case :rabbit_misc.rpc_call(node, :rabbit_khepri, :is_enabled, []) do
true ->
assert match?({:error, :rabbitmq_unexpectedly_running}, ret)
assert match?({:error, ~c"Forced reset is unsupported with Khepri"}, ret)
false ->
assert match?({:error, :mnesia_unexpectedly_running}, ret)