diff options
| author | Daniil Fedotov <dfedotov@pivotal.io> | 2016-08-26 11:12:22 +0100 |
|---|---|---|
| committer | Daniil Fedotov <dfedotov@pivotal.io> | 2016-08-26 11:12:22 +0100 |
| commit | 3234494e06c3c8f8d8b85573212806492fecdc5e (patch) | |
| tree | f81fff80f3bbb3362b0e0c05dc5a9cb2ed6f0df7 /test | |
| parent | 0593afdd05bed1619e197487ee1170a1b95cf6eb (diff) | |
| download | rabbitmq-server-git-3234494e06c3c8f8d8b85573212806492fecdc5e.tar.gz | |
Test policy and operator policy message ttl
Diffstat (limited to 'test')
| -rw-r--r-- | test/priority_queue_SUITE.erl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/priority_queue_SUITE.erl b/test/priority_queue_SUITE.erl index 8e1b48dd3b..9de7a9c1ca 100644 --- a/test/priority_queue_SUITE.erl +++ b/test/priority_queue_SUITE.erl @@ -32,6 +32,8 @@ groups() -> {cluster_size_2, [], [ ackfold, drop, + policy_ttl, + operator_policy_ttl, dropwhile_fetchwhile, info_head_message_timestamp, matching, @@ -232,6 +234,46 @@ dropwhile_fetchwhile(Config) -> rabbit_ct_client_helpers:close_connection(Conn), passed. +policy_ttl(Config) -> + {Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), + Q = <<"policy_ttl-queue">>, + rabbit_ct_broker_helpers:set_policy(Config, 0, <<"ttl-policy">>, + <<"policy_ttl-queue">>, <<"all">>, [{<<"message-ttl">>, 1}]), + + declare(Ch, Q, arguments(3)), + publish(Ch, Q, [1, 2, 3, 1, 2, 3, 1, 2, 3]), + timer:sleep(5), + get_empty(Ch, Q), + delete(Ch, Q), + + rabbit_ct_broker_helpers:clear_policy(Config, 0, <<"ttl-policy">>), + + rabbit_ct_client_helpers:close_channel(Ch), + rabbit_ct_client_helpers:close_connection(Conn), + passed. + +operator_policy_ttl(Config) -> + {Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), + Q = <<"policy_ttl-queue">>, + % Operator policy will override + rabbit_ct_broker_helpers:set_policy(Config, 0, <<"ttl-policy">>, + <<"policy_ttl-queue">>, <<"all">>, [{<<"message-ttl">>, 100}]), + rabbit_ct_broker_helpers:set_operator_policy(Config, 0, <<"ttl-policy-op">>, + <<"policy_ttl-queue">>, <<"all">>, [{<<"message-ttl">>, 1}]), + + declare(Ch, Q, arguments(3)), + publish(Ch, Q, [1, 2, 3, 1, 2, 3, 1, 2, 3]), + timer:sleep(5), + get_empty(Ch, Q), + delete(Ch, Q), + + rabbit_ct_broker_helpers:clear_policy(Config, 0, <<"ttl-policy">>), + rabbit_ct_broker_helpers:clear_operator_policy(Config, 0, <<"ttl-policy-op">>), + + rabbit_ct_client_helpers:close_channel(Ch), + rabbit_ct_client_helpers:close_connection(Conn), + passed. + ackfold(Config) -> {Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), Q = <<"ackfolq-queue1">>, |
