diff options
Diffstat (limited to 'deps/rabbitmq_cli/test/diagnostics')
17 files changed, 19 insertions, 23 deletions
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs index f820e258c1..5f521cd8aa 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs @@ -53,7 +53,7 @@ defmodule CheckAlarmsCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when target node has no alarms in effect, returns an empty list", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs index f0a888d234..fcb5bf1416 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs @@ -53,7 +53,7 @@ defmodule CheckLocalAlarmsCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when target node has no alarms in effect, returns an empty list", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs index ce818d6c3c..c6525a2a4f 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs @@ -46,7 +46,7 @@ defmodule CheckPortConnectivityCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: tries to connect to every inferred active listener", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs index eed32c87db..70c3b5f4dc 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs @@ -50,7 +50,7 @@ defmodule CheckPortListenerCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([61613], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([61613], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when a listener for the protocol is active, returns a success", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs index 44834386aa..79608de63d 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs @@ -50,7 +50,7 @@ defmodule CheckProtocolListenerCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run(["stomp"], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run(["stomp"], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when a listener for the protocol is active, returns a success", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs index 763639b113..6ebfa4513f 100644 --- a/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs @@ -52,7 +52,7 @@ defmodule CheckRunningCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when the RabbitMQ app is booted and started, returns true", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs index 65487250ec..22f9462284 100644 --- a/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs @@ -72,7 +72,7 @@ defmodule CipherSuitesCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: returns a list of cipher suites", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs index 160aca3045..4a603227cb 100644 --- a/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs @@ -47,10 +47,8 @@ defmodule ErlangCookieHashCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - target = :jake@thedog - - opts = %{node: target} - assert @command.run([], Map.merge(context[:opts], opts)) == {:badrpc, :nodedown} + opts = %{node: :jake@thedog, timeout: 200} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], opts))) end test "run: returns the erlang cookie hash", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs index f94b6efc90..4e169a41fe 100644 --- a/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs @@ -52,7 +52,7 @@ defmodule ErlangVersionCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog, details: false})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog, details: false}))) end test "run: returns Erlang/OTP version on the target node", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs index cf1556b060..f53e900625 100644 --- a/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs @@ -52,7 +52,7 @@ defmodule IsBootingCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when the RabbitMQ app is fully booted and running, returns false", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs index 9b7b60f540..068e50844c 100644 --- a/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs @@ -52,7 +52,7 @@ defmodule IsRunningCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: when the RabbitMQ app is booted and started, returns true", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs index 96ebabfdad..aaa0049524 100644 --- a/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs @@ -53,7 +53,7 @@ defmodule ListenersCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: returns a list of node-local listeners", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs index c073ccd005..694ca6c025 100644 --- a/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs @@ -48,7 +48,7 @@ defmodule MaybeStuckCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end @tag test_timeout: 0 diff --git a/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs index a7582ce200..0a550a545d 100644 --- a/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs @@ -70,10 +70,8 @@ defmodule MemoryBreakdownCommandTest do end test "run: request to a non-existent RabbitMQ node returns a nodedown" do - target = :jake@thedog - - opts = %{node: target, timeout: 5000, unit: "gb"} - assert match?({:badrpc, :nodedown}, @command.run([], opts)) + opts = %{node: :jake@thedog, timeout: 200, unit: "gb"} + assert match?({:badrpc, _}, @command.run([], opts)) end test "banner", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs index 4346058d39..fd72c33eba 100644 --- a/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs @@ -46,7 +46,7 @@ defmodule RuntimeThreadStatsCommandTest do @tag test_timeout: 2000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end @tag test_timeout: 6000 diff --git a/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs index ac1250eb0f..198a9147c8 100644 --- a/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs @@ -47,7 +47,7 @@ defmodule ServerVersionCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run: returns RabbitMQ version on the target node", context do diff --git a/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs index a70481d75c..a4ff347ca9 100644 --- a/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs @@ -46,7 +46,7 @@ defmodule TlsVersionsCommandTest do @tag test_timeout: 3000 test "run: targeting an unreachable node throws a badrpc", context do - assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown} + assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog}))) end test "run when formatter is set to JSON: return a document with a list of supported TLS versions", context do |