@@ -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 ,
@@ -461,10 +462,37 @@ vhost_is_created_with_default_limits(Config) ->
461
462
? assertEqual (ok , rabbit_ct_broker_helpers :add_vhost (Config , VHost )),
462
463
? assertEqual (Limits , rabbit_ct_broker_helpers :rpc (Config , 0 ,
463
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 ])
464
492
after
465
493
rabbit_ct_broker_helpers :rpc (
466
494
Config , 0 ,
467
- application , unset_env , [rabbit , default_limits ])
495
+ application , unset_env , [rabbit , default_queue_type ])
468
496
end .
469
497
470
498
vhost_is_created_with_operator_policies (Config ) ->
0 commit comments