@@ -27,6 +27,7 @@ all() ->
27
27
groups () ->
28
28
ClusterSize1Tests = [
29
29
vhost_is_created_with_default_limits ,
30
+ vhost_is_created_with_default_queue_type ,
30
31
vhost_is_created_with_operator_policies ,
31
32
vhost_is_created_with_default_user ,
32
33
single_node_vhost_deletion_forces_connection_closure ,
@@ -307,13 +308,14 @@ vhost_update_default_queue_type_undefined(Config) ->
307
308
VHost = <<" update-default_queue_type-with-undefined-test" >>,
308
309
Description = <<" rmqfpas-105 test vhost" >>,
309
310
Tags = [replicate , private ],
310
- DefaultQueueType = quorum ,
311
+ VhostDefaultQueueType = quorum ,
312
+ NodeDefaultQueueType = rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_queue_type , default_alias , []),
311
313
Trace = false ,
312
314
ActingUser = <<" acting-user" >>,
313
315
try
314
316
? assertMatch (ok , rabbit_ct_broker_helpers :add_vhost (Config , VHost )),
315
317
316
- PutVhostArgs0 = [VHost , Description , Tags , DefaultQueueType , Trace , ActingUser ],
318
+ PutVhostArgs0 = [VHost , Description , Tags , VhostDefaultQueueType , Trace , ActingUser ],
317
319
? assertMatch (ok ,
318
320
rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_vhost , put_vhost , PutVhostArgs0 )),
319
321
@@ -322,7 +324,7 @@ vhost_update_default_queue_type_undefined(Config) ->
322
324
rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_vhost , put_vhost , PutVhostArgs1 )),
323
325
324
326
V = rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_vhost , lookup , [VHost ]),
325
- ? assertMatch (#{default_queue_type := DefaultQueueType }, vhost :get_metadata (V ))
327
+ ? assertMatch (#{default_queue_type := NodeDefaultQueueType }, vhost :get_metadata (V ))
326
328
after
327
329
rabbit_ct_broker_helpers :delete_vhost (Config , VHost )
328
330
end .
@@ -460,10 +462,37 @@ vhost_is_created_with_default_limits(Config) ->
460
462
? assertEqual (ok , rabbit_ct_broker_helpers :add_vhost (Config , VHost )),
461
463
? assertEqual (Limits , rabbit_ct_broker_helpers :rpc (Config , 0 ,
462
464
rabbit_vhost_limit , list , [VHost ]))
465
+ after
466
+ rabbit_ct_broker_helpers :rpc (
467
+ Config , 0 ,
468
+ application , unset_env , [rabbit , default_limits ])
469
+ end .
470
+
471
+ vhost_is_created_with_default_queue_type (Config ) ->
472
+ VHost = atom_to_binary (? FUNCTION_NAME ),
473
+ QName = atom_to_binary (? FUNCTION_NAME ),
474
+ ? assertEqual (ok , rabbit_ct_broker_helpers :rpc (Config , 0 ,
475
+ application , set_env , [rabbit , default_queue_type , rabbit_quorum_queue ])),
476
+ try
477
+ ? assertEqual (ok , rabbit_ct_broker_helpers :add_vhost (Config , VHost )),
478
+ rabbit_ct_broker_helpers :set_full_permissions (Config , <<" guest" >>, VHost ),
479
+ ? assertEqual (<<" quorum" >>, rabbit_ct_broker_helpers :rpc (Config , 0 ,
480
+ rabbit_vhost , default_queue_type , [VHost ])),
481
+ V = rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_db_vhost , get , [VHost ]),
482
+ ct :pal (" Vhost metadata: ~p " , [V ]),
483
+ ? assertEqual (<<" quorum" >>, maps :get (default_queue_type , vhost :get_metadata (V ))),
484
+
485
+ Conn = rabbit_ct_client_helpers :open_unmanaged_connection (Config , 0 , VHost ),
486
+ {ok , Chan } = amqp_connection :open_channel (Conn ),
487
+ amqp_channel :call (Chan , # 'queue.declare' {queue = QName , durable = true }),
488
+ QNameRes = rabbit_misc :r (VHost , queue , QName ),
489
+ {ok , Q } = rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_amqqueue , lookup , [QNameRes ]),
490
+ ? assertMatch (rabbit_quorum_queue , amqqueue :get_type (Q )),
491
+ close_connections ([Conn ])
463
492
after
464
493
rabbit_ct_broker_helpers :rpc (
465
494
Config , 0 ,
466
- application , unset_env , [rabbit , default_limits ])
495
+ application , unset_env , [rabbit , default_queue_type ])
467
496
end .
468
497
469
498
vhost_is_created_with_operator_policies (Config ) ->
0 commit comments