|
|
@@ -19,13 +19,13 @@
|
|
|
-compile(nowarn_export_all).
|
|
|
-compile(export_all).
|
|
|
|
|
|
+-include("emqx_connector.hrl").
|
|
|
-include("emqx_authn.hrl").
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
|
-include_lib("common_test/include/ct.hrl").
|
|
|
-include_lib("emqx/include/emqx_placeholder.hrl").
|
|
|
|
|
|
-define(PGSQL_HOST, "pgsql").
|
|
|
--define(PGSQL_PORT, 5432).
|
|
|
-define(PGSQL_RESOURCE, <<"emqx_authn_pgsql_SUITE">>).
|
|
|
|
|
|
-define(PATH, [authentication]).
|
|
|
@@ -54,7 +54,7 @@ end_per_group(require_seeds, Config) ->
|
|
|
|
|
|
init_per_suite(Config) ->
|
|
|
_ = application:load(emqx_conf),
|
|
|
- case emqx_common_test_helpers:is_tcp_server_available(?PGSQL_HOST, ?PGSQL_PORT) of
|
|
|
+ case emqx_common_test_helpers:is_tcp_server_available(?PGSQL_HOST, ?PGSQL_DEFAULT_PORT) of
|
|
|
true ->
|
|
|
ok = emqx_common_test_helpers:start_apps([emqx_authn]),
|
|
|
ok = start_apps([emqx_resource, emqx_connector]),
|
|
|
@@ -439,10 +439,7 @@ drop_seeds() ->
|
|
|
ok.
|
|
|
|
|
|
pgsql_server() ->
|
|
|
- iolist_to_binary(
|
|
|
- io_lib:format(
|
|
|
- "~s:~b",
|
|
|
- [?PGSQL_HOST, ?PGSQL_PORT])).
|
|
|
+ iolist_to_binary(io_lib:format("~s",[?PGSQL_HOST])).
|
|
|
|
|
|
pgsql_config() ->
|
|
|
#{auto_reconnect => true,
|
|
|
@@ -450,7 +447,7 @@ pgsql_config() ->
|
|
|
username => <<"root">>,
|
|
|
password => <<"public">>,
|
|
|
pool_size => 8,
|
|
|
- server => {?PGSQL_HOST, ?PGSQL_PORT},
|
|
|
+ server => {?PGSQL_HOST, ?PGSQL_DEFAULT_PORT},
|
|
|
ssl => #{enable => false}
|
|
|
}.
|
|
|
|