summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-09-21 16:06:59 +0300
committerMichael Klishin <michael@clojurewerkz.org>2016-09-21 16:06:59 +0300
commited9356dba7db48f2637475bef67c60ea784b1bd6 (patch)
treecde2eef85dcfe3b5be1ae763b8a14a06133458f8
parent74308064e56fb975488f260b7cc8652162c88714 (diff)
downloadrabbitmq-server-git-ed9356dba7db48f2637475bef67c60ea784b1bd6.tar.gz
Add a test that ensures max queue limit isn't enforced for re-declaration
-rw-r--r--test/per_vhost_queue_limit_SUITE.erl63
1 files changed, 61 insertions, 2 deletions
diff --git a/test/per_vhost_queue_limit_SUITE.erl b/test/per_vhost_queue_limit_SUITE.erl
index 9e6c4120a4..1c6bea08dd 100644
--- a/test/per_vhost_queue_limit_SUITE.erl
+++ b/test/per_vhost_queue_limit_SUITE.erl
@@ -41,7 +41,8 @@ groups() ->
single_node_single_vhost_zero_limit,
single_node_single_vhost_limit_with_durable_named_queue,
single_node_single_vhost_zero_limit_with_durable_named_queue,
- single_node_single_vhost_limit_with_queue_ttl
+ single_node_single_vhost_limit_with_queue_ttl,
+ single_node_single_vhost_limit_with_redeclaration
]},
{cluster_size_2, [], [
most_basic_cluster_queue_count,
@@ -214,7 +215,7 @@ single_node_single_vhost_limit_with_durable_named_queue(Config) ->
expect_shutdown_due_to_precondition_failed(
fun () ->
- amqp_channel:call(Ch, #'queue.declare'{queue = <<"Q3">>,
+ amqp_channel:call(Ch, #'queue.declare'{queue = <<"Q4">>,
exclusive = false,
durable = true})
end),
@@ -316,6 +317,64 @@ single_node_single_vhost_limit_with_queue_ttl(Config) ->
rabbit_ct_broker_helpers:delete_vhost(Config, VHost).
+single_node_single_vhost_limit_with_redeclaration(Config) ->
+ VHost = <<"queue-limits">>,
+ set_up_vhost(Config, VHost),
+ ?assertEqual(0, count_queues_in(Config, VHost)),
+
+ set_vhost_queue_limit(Config, VHost, 3),
+ Conn1 = open_unmanaged_connection(Config, 0, VHost),
+ {ok, Ch1} = amqp_connection:open_channel(Conn1),
+
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch1, #'queue.declare'{queue = <<"Q1">>,
+ exclusive = false,
+ durable = true}),
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch1, #'queue.declare'{queue = <<"Q2">>,
+ exclusive = false,
+ durable = true}),
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch1, #'queue.declare'{queue = <<"Q3">>,
+ exclusive = false,
+ durable = true}),
+
+ %% can't declare a new queue...
+ expect_shutdown_due_to_precondition_failed(
+ fun () ->
+ amqp_channel:call(Ch1, #'queue.declare'{queue = <<"Q4">>,
+ exclusive = false,
+ durable = true})
+ end),
+
+
+ Conn2 = open_unmanaged_connection(Config, 0, VHost),
+ {ok, Ch2} = amqp_connection:open_channel(Conn2),
+
+ %% ...but re-declarations succeed
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch2, #'queue.declare'{queue = <<"Q1">>,
+ exclusive = false,
+ durable = true}),
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch2, #'queue.declare'{queue = <<"Q2">>,
+ exclusive = false,
+ durable = true}),
+ #'queue.declare_ok'{queue = _} =
+ amqp_channel:call(Ch2, #'queue.declare'{queue = <<"Q3">>,
+ exclusive = false,
+ durable = true}),
+
+ expect_shutdown_due_to_precondition_failed(
+ fun () ->
+ amqp_channel:call(Ch2, #'queue.declare'{queue = <<"Q4">>,
+ exclusive = false,
+ durable = true})
+ end),
+
+ rabbit_ct_broker_helpers:delete_vhost(Config, VHost).
+
+
most_basic_cluster_queue_count(Config) ->
VHost = <<"queue-limits">>,
set_up_vhost(Config, VHost),