Skip to content

Commit 20539a0

Browse files
Use --no-table-headers with list_* CLI commands
The suites do not expect (or care for) the header row. Per discussion with @dumbbell @hairyhum. References rabbitmq/rabbitmq-cli#264. (cherry picked from commit 8ed6b44)
1 parent 6c00f60 commit 20539a0

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

test/list_consumers_sanity_check_SUITE.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ list_consumers_sanity_check(Config) ->
9191
%% `rabbitmqctl report` shares some code with `list_consumers`, so
9292
%% check that it also reports both channels
9393
{ok, ReportStdOut} = rabbit_ct_broker_helpers:rabbitmqctl(Config, A,
94-
["list_consumers"]),
94+
["list_consumers", "--no-table-headers"]),
9595
ReportLines = re:split(ReportStdOut, <<"\n">>, [trim]),
9696
ReportCTags = [lists:nth(3, re:split(Row, <<"\t">>)) || <<"list_consumers_q", _/binary>> = Row <- ReportLines],
9797
true = (lists:sort([CTag1, CTag2]) =:=
9898
lists:sort(ReportCTags)).
9999

100100
rabbitmqctl_list_consumers(Config, Node) ->
101101
{ok, StdOut} = rabbit_ct_broker_helpers:rabbitmqctl(Config, Node,
102-
["list_consumers"]),
102+
["list_consumers", "--no-table-headers"]),
103103
[<<"Listing consumers", _/binary>> | ConsumerRows] = re:split(StdOut, <<"\n">>, [trim]),
104104
CTags = [ lists:nth(3, re:split(Row, <<"\t">>)) || Row <- ConsumerRows ],
105105
CTags.
@@ -117,17 +117,17 @@ list_queues_online_and_offline(Config) ->
117117
rabbit_ct_broker_helpers:rabbitmqctl(Config, B, ["stop"]),
118118

119119
GotUp = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
120-
["list_queues", "--online", "name"])),
120+
["list_queues", "--online", "name", "--no-table-headers"])),
121121
ExpectUp = [[<<"q_a_1">>], [<<"q_a_2">>]],
122122
ExpectUp = GotUp,
123123

124124
GotDown = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
125-
["list_queues", "--offline", "name"])),
125+
["list_queues", "--offline", "name", "--no-table-headers"])),
126126
ExpectDown = [[<<"q_b_1">>], [<<"q_b_2">>]],
127127
ExpectDown = GotDown,
128128

129129
GotAll = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
130-
["list_queues", "name"])),
130+
["list_queues", "name", "--no-table-headers"])),
131131
ExpectAll = ExpectUp ++ ExpectDown,
132132
ExpectAll = GotAll,
133133

test/list_queues_online_and_offline_SUITE.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ list_queues_online_and_offline(Config) ->
8686
rabbit_ct_broker_helpers:rabbitmqctl(Config, B, ["stop"]),
8787

8888
GotUp = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
89-
["list_queues", "--online", "name"])),
89+
["list_queues", "--online", "name", "--no-table-headers"])),
9090
ExpectUp = [[<<"q_a_1">>], [<<"q_a_2">>]],
9191
ExpectUp = GotUp,
9292

9393
GotDown = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
94-
["list_queues", "--offline", "name"])),
94+
["list_queues", "--offline", "name", "--no-table-headers"])),
9595
ExpectDown = [[<<"q_b_1">>], [<<"q_b_2">>]],
9696
ExpectDown = GotDown,
9797

9898
GotAll = lists:sort(rabbit_ct_broker_helpers:rabbitmqctl_list(Config, A,
99-
["list_queues", "name"])),
99+
["list_queues", "name", "--no-table-headers"])),
100100
ExpectAll = ExpectUp ++ ExpectDown,
101101
ExpectAll = GotAll,
102102

test/policy_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ operator_retroactive_policy_publish_ttl(Config) ->
147147
%% the queue
148148
publish(Ch, Q, lists:seq(1, 25)),
149149
timer:sleep(50),
150-
[[<<"policy_ttl-queue">>, <<"75">>]] = rabbit_ct_broker_helpers:rabbitmqctl_list(Config, 0, ["list_queues"]),
150+
[[<<"policy_ttl-queue">>, <<"75">>]] =
151+
rabbit_ct_broker_helpers:rabbitmqctl_list(Config, 0, ["list_queues", "--no-table-headers"]),
151152
get_messages(50, Ch, Q),
152153
delete(Ch, Q),
153154

test/rabbitmqctl_integration_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ list_queues_stopped(Config) ->
151151
ListedQueues =
152152
[ {Name, State}
153153
|| [Name, State] <- rabbit_ct_broker_helpers:rabbitmqctl_list(
154-
Config, 0, ["list_queues", "name", "state"]) ],
154+
Config, 0, ["list_queues", "name", "state", "--no-table-headers"]) ],
155155

156156
[ <<"running">> = proplists:get_value(Q, ListedQueues) || Q <- Node1Queues ],
157157
%% Node is running. Vhost is down
@@ -176,4 +176,4 @@ assert_ctl_queues(Config, Node, Args, Expected0) ->
176176
end.
177177

178178
run_list_queues(Config, Node, Args) ->
179-
rabbit_ct_broker_helpers:rabbitmqctl_list(Config, Node, ["list_queues"] ++ Args ++ ["name"]).
179+
rabbit_ct_broker_helpers:rabbitmqctl_list(Config, Node, ["list_queues"] ++ Args ++ ["name", "--no-table-headers"]).

0 commit comments

Comments
 (0)