@@ -160,7 +160,7 @@ end_per_testcase(Testcase, Config) ->
160
160
simple (Config ) ->
161
161
with_ch (Config ,
162
162
fun (Ch ) ->
163
- expect_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>)
163
+ expect_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>)
164
164
end , upstream_downstream (Config )).
165
165
166
166
multiple_upstreams_pattern (Config ) ->
@@ -200,9 +200,9 @@ multiple_downstreams(Config) ->
200
200
with_ch (Config ,
201
201
fun (Ch ) ->
202
202
timer :sleep (? INITIAL_WAIT ),
203
- expect_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
204
- expect_federation (Ch , <<" upstream " >>, <<" fed.downstream2 " >>, ? EXPECT_FEDERATION_TIMEOUT )
205
- end , upstream_downstream (Config ) ++ [q (<<" fed.downstream2 " >>, Args )]).
203
+ expect_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
204
+ expect_federation (Ch , <<" upstream2 " >>, <<" fed2.downstream " >>, ? EXPECT_FEDERATION_TIMEOUT )
205
+ end , upstream_downstream (Config ) ++ [q (<<" fed2.downstream " >>, Args )]).
206
206
207
207
message_flow (Config ) ->
208
208
% % TODO: specifc source / target here
@@ -236,11 +236,11 @@ dynamic_reconfiguration(Config) ->
236
236
with_ch (Config ,
237
237
fun (Ch ) ->
238
238
timer :sleep (? INITIAL_WAIT ),
239
- expect_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
239
+ expect_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
240
240
241
241
% % Test that clearing connections works
242
242
clear_upstream (Config , 0 , <<" localhost" >>),
243
- expect_no_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>),
243
+ expect_no_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>),
244
244
245
245
% % Test that reading them and changing them works
246
246
set_upstream (Config , 0 ,
@@ -249,45 +249,46 @@ dynamic_reconfiguration(Config) ->
249
249
URI = rabbit_ct_broker_helpers :node_uri (Config , 0 , [use_ipaddr ]),
250
250
set_upstream (Config , 0 , <<" localhost" >>, URI ),
251
251
set_upstream (Config , 0 , <<" localhost" >>, URI ),
252
- expect_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>)
252
+ expect_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>)
253
253
end , upstream_downstream (Config )).
254
254
255
255
federate_unfederate (Config ) ->
256
256
Args = ? config (target_queue_args , Config ),
257
257
with_ch (Config ,
258
258
fun (Ch ) ->
259
259
timer :sleep (? INITIAL_WAIT ),
260
- expect_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
261
- expect_federation (Ch , <<" upstream " >>, <<" fed.downstream2 " >>, ? EXPECT_FEDERATION_TIMEOUT ),
260
+ expect_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>, ? EXPECT_FEDERATION_TIMEOUT ),
261
+ expect_federation (Ch , <<" upstream2 " >>, <<" fed2.downstream " >>, ? EXPECT_FEDERATION_TIMEOUT ),
262
262
263
263
% % clear the policy
264
264
rabbit_ct_broker_helpers :clear_policy (Config , 0 , <<" fed" >>),
265
265
266
- expect_no_federation (Ch , <<" upstream" >>, <<" fed .downstream" >>),
267
- expect_no_federation (Ch , <<" upstream " >>, <<" fed.downstream2 " >>),
266
+ expect_no_federation (Ch , <<" upstream" >>, <<" fed1 .downstream" >>),
267
+ expect_no_federation (Ch , <<" upstream2 " >>, <<" fed2.downstream " >>),
268
268
269
269
rabbit_ct_broker_helpers :set_policy (Config , 0 ,
270
- <<" fed" >>, <<" ^fed \. " >>, <<" all" >>, [
270
+ <<" fed" >>, <<" ^fed1 \. " >>, <<" all" >>, [
271
271
{<<" federation-upstream-set" >>, <<" upstream" >>}])
272
- end , upstream_downstream (Config ) ++ [q (<<" fed.downstream2 " >>, Args )]).
272
+ end , upstream_downstream (Config ) ++ [q (<<" fed2.downstream " >>, Args )]).
273
273
274
274
dynamic_plugin_stop_start (Config ) ->
275
- DownQ2 = <<" fed.downstream2 " >>,
275
+ DownQ2 = <<" fed2.downstream " >>,
276
276
Args = ? config (target_queue_args , Config ),
277
277
with_ch (Config ,
278
278
fun (Ch ) ->
279
279
timer :sleep (? INITIAL_WAIT ),
280
- UpQ = <<" upstream" >>,
281
- DownQ1 = <<" fed.downstream" >>,
282
- expect_federation (Ch , UpQ , DownQ1 , ? EXPECT_FEDERATION_TIMEOUT ),
283
- expect_federation (Ch , UpQ , DownQ2 , ? EXPECT_FEDERATION_TIMEOUT ),
280
+ UpQ1 = <<" upstream" >>,
281
+ UpQ2 = <<" upstream2" >>,
282
+ DownQ1 = <<" fed1.downstream" >>,
283
+ expect_federation (Ch , UpQ1 , DownQ1 , ? EXPECT_FEDERATION_TIMEOUT ),
284
+ expect_federation (Ch , UpQ2 , DownQ2 , ? EXPECT_FEDERATION_TIMEOUT ),
284
285
285
286
% % Disable the plugin, the link disappears
286
287
ct :pal (" Stopping rabbitmq_federation" ),
287
288
ok = rabbit_ct_broker_helpers :disable_plugin (Config , 0 , " rabbitmq_federation" ),
288
289
289
- expect_no_federation (Ch , UpQ , DownQ1 ),
290
- expect_no_federation (Ch , UpQ , DownQ2 ),
290
+ expect_no_federation (Ch , UpQ1 , DownQ1 ),
291
+ expect_no_federation (Ch , UpQ2 , DownQ2 ),
291
292
292
293
maybe_declare_queue (Config , Ch , q (DownQ1 , Args )),
293
294
maybe_declare_queue (Config , Ch , q (DownQ2 , Args )),
@@ -305,12 +306,13 @@ dynamic_plugin_stop_start(Config) ->
305
306
Entry || Entry <- Status ,
306
307
proplists :get_value (queue , Entry ) =:= DownQ1 orelse
307
308
proplists :get_value (queue , Entry ) =:= DownQ2 ,
308
- proplists :get_value (upstream_queue , Entry ) =:= UpQ ,
309
+ proplists :get_value (upstream_queue , Entry ) =:= UpQ1 orelse
310
+ proplists :get_value (upstream_queue , Entry ) =:= UpQ2 ,
309
311
proplists :get_value (status , Entry ) =:= running
310
312
],
311
313
length (L ) =:= 2
312
314
end ),
313
- expect_federation (Ch , UpQ , DownQ1 , 120000 )
315
+ expect_federation (Ch , UpQ1 , DownQ1 , 120000 )
314
316
end , upstream_downstream (Config ) ++ [q (DownQ2 , Args )]).
315
317
316
318
restart_upstream (Config ) ->
@@ -392,4 +394,4 @@ upstream_downstream() ->
392
394
upstream_downstream (Config ) ->
393
395
SourceArgs = ? config (source_queue_args , Config ),
394
396
TargetArgs = ? config (target_queue_args , Config ),
395
- [q (<<" upstream" >>, SourceArgs ), q (<<" fed .downstream" >>, TargetArgs )].
397
+ [q (<<" upstream" >>, SourceArgs ), q (<<" fed1 .downstream" >>, TargetArgs )].
0 commit comments