@@ -51,6 +51,7 @@ groups() ->
5151 {cluster_size_3 , [], [
5252 declare_args ,
5353 declare_policy ,
54+ declare_invalid_policy ,
5455 declare_policy_nodes ,
5556 declare_policy_all ,
5657 declare_policy_exactly ,
@@ -129,6 +130,19 @@ declare_policy(Config) ->
129130 declare (Config , QueueName , false , false , _Args = [], none ),
130131 verify_min_master (Config , Q ).
131132
133+ declare_invalid_policy (Config ) ->
134+ % % Tests that queue masters location returns 'ok', otherwise the validation of
135+ % % any other parameter might be skipped and invalid policy accepted.
136+ setup_test_environment (Config ),
137+ unset_location_config (Config ),
138+ Policy = [{<<" queue-master-locator" >>, <<" min-masters" >>},
139+ {<<" ha-mode" >>, <<" exactly" >>},
140+ % % this field is expected to be an integer
141+ {<<" ha-params" >>, <<" 2" >>}],
142+ {error_string , _ } = rabbit_ct_broker_helpers :rpc (
143+ Config , 0 , rabbit_policy , set ,
144+ [<<" /" >>, ? POLICY , <<" .*" >>, Policy , 0 , <<" queues" >>, <<" acting-user" >>]).
145+
132146declare_policy_nodes (Config ) ->
133147 setup_test_environment (Config ),
134148 unset_location_config (Config ),
0 commit comments