diff options
| author | Daniil Fedotov <dfedotov@pivotal.io> | 2017-04-05 13:02:16 +0100 |
|---|---|---|
| committer | Daniil Fedotov <dfedotov@pivotal.io> | 2017-04-05 13:02:27 +0100 |
| commit | 10983341be45cbf9ccee3bf61ca882d63a668bb4 (patch) | |
| tree | 033893947b1c336e4b664f3b9b3de1104850e2ae | |
| parent | 81ab2e77250073688175b6d058f15da02be4806a (diff) | |
| download | rabbitmq-server-git-10983341be45cbf9ccee3bf61ca882d63a668bb4.tar.gz | |
Change rabbitmqctl integration tests for shutdown command to support the new CLI
| -rw-r--r-- | test/rabbitmqctl_shutdown_SUITE.erl | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/test/rabbitmqctl_shutdown_SUITE.erl b/test/rabbitmqctl_shutdown_SUITE.erl index f8fd22f746..fa04dc6504 100644 --- a/test/rabbitmqctl_shutdown_SUITE.erl +++ b/test/rabbitmqctl_shutdown_SUITE.erl @@ -87,27 +87,26 @@ save_node(Config) -> successful_shutdown(Config) -> Node = ?config(node, Config), Pid = node_pid(Node), - ok = rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2), + ok = shutdown_ok(Node), false = erlang_pid_is_running(Pid), false = node_is_running(Node). error_during_shutdown(Config) -> Node = ?config(node, Config), - ok = rabbit_control_main:action(stop_app, Node, [], [], fun ct:pal/2), + ok = rabbit_ct_broker_helpers:control_action(stop_app, Node, []), ok = rpc:call(Node, application, unload, [os_mon]), {badrpc, {'EXIT', { {error, {badmatch, {error,{edge,{bad_vertex,os_mon},os_mon,rabbit}}}}, - _}}} = - rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2). + _}}} = shutdown_error(Node). nothing_to_shutdown(Config) -> Node = ?config(node, Config), - { badrpc, nodedown } = - rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2). + { error, 69, _ } = + rabbit_ct_broker_helpers:control_action(shutdown, Node, []). node_pid(Node) -> Val = rpc:call(Node, os, getpid, []), @@ -119,3 +118,20 @@ erlang_pid_is_running(Pid) -> node_is_running(Node) -> net_adm:ping(Node) == pong. + +shutdown_error(Node) -> + %% Start a command + {stream, Stream} = rabbit_ct_broker_helpers:control_action(shutdown, Node, []), + %% Execute command steps. The last one should be error + Lines = 'Elixir.Enum':to_list(Stream), + {error, Err} = lists:last(Lines), + Err. + +shutdown_ok(Node) -> + %% Start a command + {stream, Stream} = rabbit_ct_broker_helpers:control_action(shutdown, Node, []), + %% Execute command steps. Each step will ouput a binary string + Lines = 'Elixir.Enum':to_list(Stream), + ct:pal("Command output ~p ~n", [Lines]), + [true = is_binary(Line) || Line <- Lines], + ok. |
