test: move new test to newer module and use current apis
This commit is contained in:
parent
44e7f2e9b2
commit
52b2d73b28
|
@ -401,48 +401,6 @@ t_mqtt_conn_bridge_ingress_shared_subscription(_) ->
|
||||||
{ok, 204, <<>>} = request(delete, uri(["bridges", BridgeID]), []),
|
{ok, 204, <<>>} = request(delete, uri(["bridges", BridgeID]), []),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
t_connect_with_more_clients_than_the_broker_accepts(_) ->
|
|
||||||
PoolSize = 100,
|
|
||||||
OrgConf = emqx_mgmt_listeners_conf:get_raw(tcp, default),
|
|
||||||
on_exit(fun() ->
|
|
||||||
emqx_mgmt_listeners_conf:update(tcp, default, OrgConf)
|
|
||||||
end),
|
|
||||||
NewConf = OrgConf#{<<"max_connections">> => 3},
|
|
||||||
{ok, _} = emqx_mgmt_listeners_conf:update(tcp, default, NewConf),
|
|
||||||
BridgeName = atom_to_binary(?FUNCTION_NAME),
|
|
||||||
?check_trace(
|
|
||||||
#{timetrap => 10_000},
|
|
||||||
begin
|
|
||||||
BridgeID = create_bridge(
|
|
||||||
?SERVER_CONF#{
|
|
||||||
<<"name">> => BridgeName,
|
|
||||||
<<"ingress">> => #{
|
|
||||||
<<"pool_size">> => PoolSize,
|
|
||||||
<<"remote">> => #{
|
|
||||||
<<"topic">> => <<"$share/ingress/", ?INGRESS_REMOTE_TOPIC, "/#">>,
|
|
||||||
<<"qos">> => 1
|
|
||||||
},
|
|
||||||
<<"local">> => #{
|
|
||||||
<<"topic">> => <<?INGRESS_LOCAL_TOPIC, "/${topic}">>,
|
|
||||||
<<"qos">> => <<"${qos}">>,
|
|
||||||
<<"payload">> => <<"${clientid}">>,
|
|
||||||
<<"retain">> => <<"${retain}">>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
?block_until(#{?snk_kind := emqx_bridge_mqtt_connector_tcp_closed}),
|
|
||||||
{ok, 204, <<>>} = request(delete, uri(["bridges", BridgeID]), []),
|
|
||||||
ok
|
|
||||||
end,
|
|
||||||
fun(Trace) ->
|
|
||||||
?assertMatch([_ | _], ?of_kind(emqx_bridge_mqtt_connector_tcp_closed, Trace)),
|
|
||||||
ok
|
|
||||||
end
|
|
||||||
),
|
|
||||||
|
|
||||||
ok.
|
|
||||||
|
|
||||||
t_mqtt_egress_bridge_warns_clean_start(_) ->
|
t_mqtt_egress_bridge_warns_clean_start(_) ->
|
||||||
BridgeName = atom_to_binary(?FUNCTION_NAME),
|
BridgeName = atom_to_binary(?FUNCTION_NAME),
|
||||||
Action = fun() ->
|
Action = fun() ->
|
||||||
|
|
|
@ -246,3 +246,28 @@ t_receive_via_rule(Config) ->
|
||||||
end
|
end
|
||||||
),
|
),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
t_connect_with_more_clients_than_the_broker_accepts(Config0) ->
|
||||||
|
OrgConf = emqx_mgmt_listeners_conf:get_raw(tcp, default),
|
||||||
|
on_exit(fun() ->
|
||||||
|
emqx_mgmt_listeners_conf:update(tcp, default, OrgConf)
|
||||||
|
end),
|
||||||
|
NewConf = OrgConf#{<<"max_connections">> => 3},
|
||||||
|
{ok, _} = emqx_mgmt_listeners_conf:update(tcp, default, NewConf),
|
||||||
|
ConnectorConfig0 = ?config(connector_config, Config0),
|
||||||
|
ConnectorConfig = ConnectorConfig0#{<<"pool_size">> := 100},
|
||||||
|
Config = emqx_utils:merge_opts(Config0, [{connector_config, ConnectorConfig}]),
|
||||||
|
?check_trace(
|
||||||
|
#{timetrap => 10_000},
|
||||||
|
begin
|
||||||
|
{ok, _} = emqx_bridge_v2_testlib:create_bridge_api(Config),
|
||||||
|
?block_until(#{?snk_kind := emqx_bridge_mqtt_connector_tcp_closed}),
|
||||||
|
ok
|
||||||
|
end,
|
||||||
|
fun(Trace) ->
|
||||||
|
?assertMatch([_ | _], ?of_kind(emqx_bridge_mqtt_connector_tcp_closed, Trace)),
|
||||||
|
ok
|
||||||
|
end
|
||||||
|
),
|
||||||
|
|
||||||
|
ok.
|
||||||
|
|
Loading…
Reference in New Issue