@@ -25,6 +25,7 @@ groups() ->
2525 open_channel ,
2626 declare_exchange ,
2727 declare_binding ,
28+ delete_binding ,
2829 declare_queue ,
2930 publish_to_exchange ,
3031 publish_and_consume_to_local_classic_queue ,
@@ -85,7 +86,7 @@ init_per_group(Group, Config0) when Group == client_operations;
8586 {skip , _ } ->
8687 Config1 ;
8788 _ ->
88- % % Before partitioning the cluster, create a policy and queue that can be used in
89+ % % Before partitioning the cluster, create resources that can be used in
8990 % % the test cases. They're needed for delete and consume operations, which can list
9091 % % them but fail to operate anything else.
9192 % %
@@ -95,6 +96,10 @@ init_per_group(Group, Config0) when Group == client_operations;
9596 % % To be used in consume_from_queue
9697 # 'queue.declare_ok' {} = amqp_channel :call (Ch , # 'queue.declare' {queue = <<" test-queue" >>,
9798 arguments = [{<<" x-queue-type" >>, longstr , <<" classic" >>}]}),
99+ % % To be used in delete_binding
100+ # 'exchange.bind_ok' {} = amqp_channel :call (Ch , # 'exchange.bind' {destination = <<" amq.fanout" >>,
101+ source = <<" amq.direct" >>,
102+ routing_key = <<" binding-to-be-deleted" >>}),
98103
99104 % % Lower the default Khepri command timeout. By default this is set
100105 % % to 30s in `rabbit_khepri:setup/1' which makes the cases in this
@@ -160,6 +165,14 @@ declare_binding(Config) ->
160165 source = <<" amq.direct" >>,
161166 routing_key = <<" key" >>})).
162167
168+ delete_binding (Config ) ->
169+ [A | _ ] = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
170+ {_ , Ch } = rabbit_ct_client_helpers :open_connection_and_channel (Config , A ),
171+ ? assertExit ({{shutdown , {connection_closing , {server_initiated_close , 541 , _ }}}, _ },
172+ amqp_channel :call (Ch , # 'exchange.unbind' {destination = <<" amq.fanout" >>,
173+ source = <<" amq.direct" >>,
174+ routing_key = <<" binding-to-be-deleted" >>})).
175+
163176declare_queue (Config ) ->
164177 [A | _ ] = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
165178 {_ , Ch } = rabbit_ct_client_helpers :open_connection_and_channel (Config , A ),
0 commit comments