@@ -31,14 +31,23 @@ defmodule ForceResetCommandTest do
31
31
end
32
32
33
33
test "run: force reset request to an active node with a stopped rabbit app succeeds" , context do
34
- add_vhost ( "some_vhost" )
35
- # ensure the vhost really does exist
36
- assert vhost_exists? ( "some_vhost" )
37
- stop_rabbitmq_app ( )
38
- assert :ok == @ command . run ( [ ] , context [ :opts ] )
39
- start_rabbitmq_app ( )
40
- # check that the created vhost no longer exists
41
- assert match? ( [ _ ] , list_vhosts ( ) )
34
+ node = get_rabbit_hostname ( )
35
+ case :rabbit_misc . rpc_call ( node , :rabbit_khepri , :is_enabled , [ ] ) do
36
+ true ->
37
+ stop_rabbitmq_app ( )
38
+ assert { :error , ~c" Forced reset is unsupported with Khepri" } == @ command . run ( [ ] , context [ :opts ] )
39
+ start_rabbitmq_app ( )
40
+
41
+ false ->
42
+ add_vhost ( "some_vhost" )
43
+ # ensure the vhost really does exist
44
+ assert vhost_exists? ( "some_vhost" )
45
+ stop_rabbitmq_app ( )
46
+ assert :ok == @ command . run ( [ ] , context [ :opts ] )
47
+ start_rabbitmq_app ( )
48
+ # check that the created vhost no longer exists
49
+ assert match? ( [ _ ] , list_vhosts ( ) )
50
+ end
42
51
end
43
52
44
53
test "run: reset request to an active node with a running rabbit app fails" , context do
@@ -49,7 +58,7 @@ defmodule ForceResetCommandTest do
49
58
50
59
case :rabbit_misc . rpc_call ( node , :rabbit_khepri , :is_enabled , [ ] ) do
51
60
true ->
52
- assert match? ( { :error , :rabbitmq_unexpectedly_running } , ret )
61
+ assert match? ( { :error , ~c " Forced reset is unsupported with Khepri " } , ret )
53
62
54
63
false ->
55
64
assert match? ( { :error , :mnesia_unexpectedly_running } , ret )
0 commit comments