Merge pull request #11878 from kjellwinblad/kjell/shared_con/test/stop_connector_fix
test(emqx_bridge_v2_api_SUITE): fix broken test case
This commit is contained in:
commit
1b56216104
|
@ -601,13 +601,9 @@ do_start_bridge(TestType, Config) ->
|
||||||
fun(_, _, _ResId, _Channel) -> {error, <<"my_error">>} end,
|
fun(_, _, _ResId, _Channel) -> {error, <<"my_error">>} end,
|
||||||
Config
|
Config
|
||||||
),
|
),
|
||||||
ConnectorID = emqx_connector_resource:connector_id(?BRIDGE_TYPE, ?CONNECTOR_NAME),
|
|
||||||
{ok, 204, <<>>} = emqx_connector_api_SUITE:request(
|
connector_operation(Config, ?BRIDGE_TYPE, ?CONNECTOR_NAME, stop),
|
||||||
post, {operation, TestType, stop, ConnectorID}, Config
|
connector_operation(Config, ?BRIDGE_TYPE, ?CONNECTOR_NAME, start),
|
||||||
),
|
|
||||||
{ok, 204, <<>>} = emqx_connector_api_SUITE:request(
|
|
||||||
post, {operation, TestType, start, ConnectorID}, Config
|
|
||||||
),
|
|
||||||
|
|
||||||
{ok, 400, _} = request(post, {operation, TestType, start, BridgeID}, Config),
|
{ok, 400, _} = request(post, {operation, TestType, start, BridgeID}, Config),
|
||||||
|
|
||||||
|
@ -642,6 +638,32 @@ expect_on_all_nodes(Mod, Function, Fun, Config) ->
|
||||||
end,
|
end,
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
connector_operation(Config, ConnectorType, ConnectorName, OperationName) ->
|
||||||
|
case ?config(group, Config) of
|
||||||
|
cluster ->
|
||||||
|
case ?config(cluster_nodes, Config) of
|
||||||
|
undefined ->
|
||||||
|
Node = ?config(node, Config),
|
||||||
|
ok = rpc:call(
|
||||||
|
Node,
|
||||||
|
emqx_connector_resource,
|
||||||
|
OperationName,
|
||||||
|
[ConnectorType, ConnectorName],
|
||||||
|
500
|
||||||
|
);
|
||||||
|
Nodes ->
|
||||||
|
erpc:multicall(
|
||||||
|
Nodes,
|
||||||
|
emqx_connector_resource,
|
||||||
|
OperationName,
|
||||||
|
[ConnectorType, ConnectorName],
|
||||||
|
500
|
||||||
|
)
|
||||||
|
end;
|
||||||
|
_ ->
|
||||||
|
ok = emqx_connector_resource:OperationName(ConnectorType, ConnectorName)
|
||||||
|
end.
|
||||||
|
|
||||||
%% t_start_stop_inconsistent_bridge_node(Config) ->
|
%% t_start_stop_inconsistent_bridge_node(Config) ->
|
||||||
%% start_stop_inconsistent_bridge(node, Config).
|
%% start_stop_inconsistent_bridge(node, Config).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue