fix: emqx_auth_postgresql test suites

This commit is contained in:
Kjell Winblad 2023-11-24 11:01:44 +01:00
parent 6ef9c6fe4a
commit c5e281b84b
2 changed files with 19 additions and 12 deletions

View File

@ -798,7 +798,8 @@ parse_id(Id) ->
end. end.
get_channels_for_connector(ConnectorId) -> get_channels_for_connector(ConnectorId) ->
{ConnectorType, ConnectorName} = emqx_connector_resource:parse_connector_id(ConnectorId), try emqx_connector_resource:parse_connector_id(ConnectorId) of
{ConnectorType, ConnectorName} ->
RootConf = maps:keys(emqx:get_config([?ROOT_KEY], #{})), RootConf = maps:keys(emqx:get_config([?ROOT_KEY], #{})),
RelevantBridgeV2Types = [ RelevantBridgeV2Types = [
Type Type
@ -808,7 +809,13 @@ get_channels_for_connector(ConnectorId) ->
lists:flatten([ lists:flatten([
get_channels_for_connector(ConnectorName, BridgeV2Type) get_channels_for_connector(ConnectorName, BridgeV2Type)
|| BridgeV2Type <- RelevantBridgeV2Types || BridgeV2Type <- RelevantBridgeV2Types
]). ])
catch
_:_ ->
%% ConnectorId is not a valid connector id so we assume the connector
%% has no channels (e.g. it is a a connector for authn or authz)
[]
end.
get_channels_for_connector(ConnectorName, BridgeV2Type) -> get_channels_for_connector(ConnectorName, BridgeV2Type) ->
BridgeV2s = emqx:get_config([?ROOT_KEY, BridgeV2Type], #{}), BridgeV2s = emqx:get_config([?ROOT_KEY, BridgeV2Type], #{}),

View File

@ -61,7 +61,7 @@ end_per_testcase(_, _Config) ->
t_lifecycle(_Config) -> t_lifecycle(_Config) ->
perform_lifecycle_check( perform_lifecycle_check(
<<"connector:pgsql:emqx_postgresql_SUITE">>, <<"emqx_postgresql_SUITE">>,
pgsql_config() pgsql_config()
). ).