summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Corbacho <diana@rabbitmq.com>2019-05-02 22:35:08 +0100
committerDiana Corbacho <diana@rabbitmq.com>2019-05-02 22:35:08 +0100
commit6ea0a721eab1c0611264eb004286ef4394da0278 (patch)
treef3dd3817e64476924f4d8fd22b5b2d796ca00adb
parent4df419870b664ed5ebd336207a1a33691839fc9c (diff)
downloadrabbitmq-server-git-6ea0a721eab1c0611264eb004286ef4394da0278.tar.gz
Test invalid policy returns an error
[#165689664]
-rw-r--r--test/queue_master_location_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/queue_master_location_SUITE.erl b/test/queue_master_location_SUITE.erl
index f8018552d9..4564c4a486 100644
--- a/test/queue_master_location_SUITE.erl
+++ b/test/queue_master_location_SUITE.erl
@@ -51,6 +51,7 @@ groups() ->
{cluster_size_3, [], [
declare_args,
declare_policy,
+ declare_invalid_policy,
declare_policy_nodes,
declare_policy_all,
declare_policy_exactly,
@@ -129,6 +130,19 @@ declare_policy(Config) ->
declare(Config, QueueName, false, false, _Args=[], none),
verify_min_master(Config, Q).
+declare_invalid_policy(Config) ->
+ %% Tests that queue masters location returns 'ok', otherwise the validation of
+ %% any other parameter might be skipped - and policy accepted which will crash
+ %% in application
+ setup_test_environment(Config),
+ unset_location_config(Config),
+ Policy = [{<<"queue-master-locator">>, <<"min-masters">>},
+ {<<"ha-mode">>, <<"exactly">>},
+ {<<"ha-params">>, <<"2">>}],
+ {error_string, _} = rabbit_ct_broker_helpers:rpc(
+ Config, 0, rabbit_policy, set,
+ [<<"/">>, ?POLICY, <<".*">>, Policy, 0, <<"queues">>, <<"acting-user">>]).
+
declare_policy_nodes(Config) ->
setup_test_environment(Config),
unset_location_config(Config),