summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2015-08-04 00:24:47 +0300
committerMichael Klishin <mklishin@pivotal.io>2015-08-04 00:24:47 +0300
commit3f8f24bbb6f75d095f9dd68bb826afb15bc624e5 (patch)
treee1ed6d6a133931208cb4f2cf79f7c4a458b1abd5 /test
parentb5d2e0090717a5f4559fb9a68dcffa2266347004 (diff)
parent585a9690f078d720db62898d04b6405d802bb10c (diff)
downloadrabbitmq-server-git-3f8f24bbb6f75d095f9dd68bb826afb15bc624e5.tar.gz
Merge branch 'rabbitmq-server-121'
Diffstat (limited to 'test')
-rw-r--r--test/src/rabbit_tests.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl
index 95a8c45ffa..4c1489f6aa 100644
--- a/test/src/rabbit_tests.erl
+++ b/test/src/rabbit_tests.erl
@@ -72,6 +72,7 @@ all_tests0() ->
passed = test_policy_validation(),
passed = test_policy_opts_validation(),
passed = test_ha_policy_validation(),
+ passed = test_queue_master_location_policy_validation(),
passed = test_server_status(),
passed = test_amqp_connection_refusal(),
passed = test_confirms(),
@@ -1155,6 +1156,21 @@ test_ha_policy_validation() ->
ok = control_action(clear_policy, ["name"]),
passed.
+test_queue_master_location_policy_validation() ->
+ Set = fun (JSON) ->
+ control_action_opts( ["set_policy", "name", ".*", JSON] )
+ end,
+ OK = fun (JSON) -> ok = Set(JSON) end,
+ Fail = fun (JSON) -> error = Set(JSON) end,
+
+ OK ("{\"x-queue-master-locator\":\"min-masters\"}"),
+ OK ("{\"x-queue-master-locator\":\"client-local\"}"),
+ OK ("{\"x-queue-master-locator\":\"random\"}"),
+ Fail("{\"x-queue-master-locator\":\"made_up\"}"),
+
+ ok = control_action(clear_policy, ["name"]),
+ passed.
+
test_server_status() ->
%% create a few things so there is some useful information to list
{_Writer, Limiter, Ch} = test_channel(),