diff options
| author | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-07-23 16:46:03 +0100 |
|---|---|---|
| committer | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-07-23 16:46:03 +0100 |
| commit | a83a9172d1b39b9f49a50880ee8e63fb8fa71f36 (patch) | |
| tree | 9d0224d534905fe7b72c6663573b7bdf4ef23fbe | |
| parent | e12c840a4391740d2368e447a7f6fbf0e2950b59 (diff) | |
| download | rabbitmq-server-git-a83a9172d1b39b9f49a50880ee8e63fb8fa71f36.tar.gz | |
Adds policy validation tests for queue master location
References #121
| -rw-r--r-- | test/src/rabbit_tests.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl index 95a8c45ffa..db2e149ec3 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 ("{\"queue-master-location\":\"min-masters\"}"), + OK ("{\"queue-master-location\":\"client-local\"}"), + OK ("{\"queue-master-location\":\"random\"}"), + Fail("{\"queue-master-location\":\"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(), |
