diff options
| author | dcorbacho <dparracorbacho@piotal.io> | 2020-01-14 15:19:28 +0100 |
|---|---|---|
| committer | dcorbacho <dparracorbacho@piotal.io> | 2020-01-14 15:50:35 +0100 |
| commit | f3b27c75a50bc1357f6eec7f8b1359083e9c51ad (patch) | |
| tree | 9a899d2612fa52623257c9b050d4b0b87ed07e4e /test | |
| parent | 27212242463cfc3327aafd3010421f769afa7be8 (diff) | |
| download | rabbitmq-server-git-f3b27c75a50bc1357f6eec7f8b1359083e9c51ad.tar.gz | |
Filter policies that cannot be applied to quorum queues
Some policies, such as highly available, do not apply to all types of queues.
Even though quorum queues ignores some policies, they're still listed as
an applied policy on this type of queue. This commit ignores filters these
policies when applied, so they'll never be listed on the wrong type of queue.
[#169811193]
Diffstat (limited to 'test')
| -rw-r--r-- | test/quorum_queue_SUITE.erl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/quorum_queue_SUITE.erl b/test/quorum_queue_SUITE.erl index 3a872ff607..456bd31fb8 100644 --- a/test/quorum_queue_SUITE.erl +++ b/test/quorum_queue_SUITE.erl @@ -132,7 +132,8 @@ all_tests() -> queue_length_in_memory_bytes_limit, queue_length_in_memory_purge, in_memory, - consumer_metrics + consumer_metrics, + invalid_policy ]. memory_tests() -> @@ -810,6 +811,25 @@ dead_letter_policy(Config) -> ok = rabbit_ct_broker_helpers:clear_policy(Config, 0, <<"dlx">>), test_dead_lettering(false, Config, Ch, Servers, RaName, QQ, CQ). +invalid_policy(Config) -> + [Server | _] = Servers = rabbit_ct_broker_helpers:get_node_configs(Config, nodename), + + Ch = rabbit_ct_client_helpers:open_channel(Config, Server), + QQ = ?config(queue_name, Config), + ?assertEqual({'queue.declare_ok', QQ, 0, 0}, + declare(Ch, QQ, [{<<"x-queue-type">>, longstr, <<"quorum">>}])), + ok = rabbit_ct_broker_helpers:set_policy( + Config, 0, <<"ha">>, <<"invalid_policy.*">>, <<"queues">>, + [{<<"ha-mode">>, <<"all">>}]), + ok = rabbit_ct_broker_helpers:set_policy( + Config, 0, <<"ttl">>, <<"invalid_policy.*">>, <<"queues">>, + [{<<"message-ttl">>, 5}]), + Info = rpc:call(Server, rabbit_quorum_queue, infos, + [rabbit_misc:r(<<"/">>, queue, QQ)]), + ?assertEqual('', proplists:get_value(policy, Info)), + ok = rabbit_ct_broker_helpers:clear_policy(Config, 0, <<"ha">>), + ok = rabbit_ct_broker_helpers:clear_policy(Config, 0, <<"ttl">>). + dead_letter_to_quorum_queue(Config) -> [Server | _] = Servers = rabbit_ct_broker_helpers:get_node_configs(Config, nodename), |
