@@ -1662,18 +1662,19 @@ events(Config) ->
16621662
16631663 Protocol = {protocol , {1 , 0 }},
16641664 AuthProps = [{name , <<" guest" >>},
1665- {auth_mechanism , <<" PLAIN" >>},
1666- {ssl , false },
1667- Protocol ],
1665+ {auth_mechanism , <<" PLAIN" >>},
1666+ {ssl , false },
1667+ Protocol ],
16681668 ? assertMatch (
1669- {value , _ },
1670- find_event (user_authentication_success , AuthProps , Events )),
1669+ {value , _ },
1670+ find_event (user_authentication_success , AuthProps , Events )),
16711671
16721672 Node = get_node_config (Config , 0 , nodename ),
16731673 ConnectionCreatedProps = [Protocol ,
16741674 {node , Node },
16751675 {vhost , <<" /" >>},
16761676 {user , <<" guest" >>},
1677+ {container_id , <<" my container" >>},
16771678 {type , network }],
16781679 {value , ConnectionCreatedEvent } = find_event (
16791680 connection_created ,
@@ -1694,8 +1695,8 @@ events(Config) ->
16941695 Pid ,
16951696 ClientProperties ],
16961697 ? assertMatch (
1697- {value , _ },
1698- find_event (connection_closed , ConnectionClosedProps , Events )),
1698+ {value , _ },
1699+ find_event (connection_closed , ConnectionClosedProps , Events )),
16991700 ok .
17001701
17011702sync_get_unsettled_classic_queue (Config ) ->
@@ -3696,17 +3697,21 @@ list_connections(Config) ->
36963697 [ok = rabbit_ct_client_helpers :close_channels_and_connection (Config , Node ) || Node <- [0 , 1 , 2 ]],
36973698
36983699 Connection091 = rabbit_ct_client_helpers :open_unmanaged_connection (Config , 0 ),
3699- {ok , C0 } = amqp10_client :open_connection (connection_config (0 , Config )),
3700- {ok , C2 } = amqp10_client :open_connection (connection_config (2 , Config )),
3700+ ContainerId0 = <<" ID 0" >>,
3701+ ContainerId2 = <<" ID 2" >>,
3702+ Cfg0 = maps :put (container_id , ContainerId0 , connection_config (0 , Config )),
3703+ Cfg2 = maps :put (container_id , ContainerId2 , connection_config (2 , Config )),
3704+ {ok , C0 } = amqp10_client :open_connection (Cfg0 ),
3705+ {ok , C2 } = amqp10_client :open_connection (Cfg2 ),
37013706 receive {amqp10_event , {connection , C0 , opened }} -> ok
37023707 after 5000 -> ct :fail ({missing_event , ? LINE })
37033708 end ,
37043709 receive {amqp10_event , {connection , C2 , opened }} -> ok
37053710 after 5000 -> ct :fail ({missing_event , ? LINE })
37063711 end ,
37073712
3708- {ok , StdOut } = rabbit_ct_broker_helpers :rabbitmqctl (Config , 0 , [" list_connections" , " --silent" , " protocol" ]),
3709- Protocols0 = re :split (StdOut , <<" \n " >>, [trim ]),
3713+ {ok , StdOut0 } = rabbit_ct_broker_helpers :rabbitmqctl (Config , 0 , [" list_connections" , " --silent" , " protocol" ]),
3714+ Protocols0 = re :split (StdOut0 , <<" \n " >>, [trim ]),
37103715 % % Remove any whitespaces.
37113716 Protocols1 = [binary :replace (Subject , <<" " >>, <<>>, [global ]) || Subject <- Protocols0 ],
37123717 Protocols = lists :sort (Protocols1 ),
@@ -3715,6 +3720,13 @@ list_connections(Config) ->
37153720 <<" {1,0}" >>],
37163721 Protocols ),
37173722
3723+ % % CLI should list AMQP 1.0 container-id
3724+ {ok , StdOut1 } = rabbit_ct_broker_helpers :rabbitmqctl (Config , 0 , [" list_connections" , " --silent" , " container_id" ]),
3725+ ContainerIds0 = re :split (StdOut1 , <<" \n " >>, [trim ]),
3726+ ContainerIds = lists :sort (ContainerIds0 ),
3727+ ? assertEqual ([<<>>, ContainerId0 , ContainerId2 ],
3728+ ContainerIds ),
3729+
37183730 ok = rabbit_ct_client_helpers :close_connection (Connection091 ),
37193731 ok = close_connection_sync (C0 ),
37203732 ok = close_connection_sync (C2 ).
@@ -6021,8 +6033,8 @@ find_event(Type, Props, Events) when is_list(Props), is_list(Events) ->
60216033 fun (# event {type = EventType , props = EventProps }) ->
60226034 Type =:= EventType andalso
60236035 lists :all (
6024- fun ({ Key , _Value } ) ->
6025- lists :keymember ( Key , 1 , EventProps )
6036+ fun (Prop ) ->
6037+ lists :member ( Prop , EventProps )
60266038 end , Props )
60276039 end , Events ).
60286040
0 commit comments