fix: bad SUITE & bad code
This commit is contained in:
parent
7417e5070d
commit
75f612a449
|
@ -24,7 +24,8 @@
|
|||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
|
||||
-define(MYSQL_HOST, "mysql").
|
||||
-define(MYSQL_HOST, "192.168.1.234").
|
||||
% -define(MYSQL_HOST, "mysql").
|
||||
-define(MYSQL_RESOURCE, <<"emqx_authn_mysql_SUITE">>).
|
||||
|
||||
-define(PATH, [authentication]).
|
||||
|
@ -198,11 +199,10 @@ t_update(_Config) ->
|
|||
>>
|
||||
},
|
||||
|
||||
%% Code 1146, table not exist
|
||||
{error, {post_config_update,emqx_authentication, {1146, _, _}}} =
|
||||
emqx:update_config(
|
||||
?PATH,
|
||||
{create_authenticator, ?GLOBAL, IncorrectConfig}),
|
||||
{ok, _} = emqx:update_config(
|
||||
?PATH,
|
||||
{create_authenticator, ?GLOBAL, IncorrectConfig}
|
||||
),
|
||||
|
||||
{error, not_authorized} = emqx_access_control:authenticate(
|
||||
#{
|
||||
|
|
|
@ -51,7 +51,7 @@ description() ->
|
|||
|
||||
init(#{query := SQL} = Source0) ->
|
||||
{PrepareSQL, TmplToken} = emqx_authz_utils:parse_sql(SQL, '?', ?PLACEHOLDERS),
|
||||
Source = Source0#{prepare_statement := #{?MODULE => PrepareSQL}},
|
||||
Source = Source0#{prepare_statement => #{?MODULE => PrepareSQL}},
|
||||
case emqx_authz_utils:create_resource(emqx_connector_mysql, Source) of
|
||||
{error, Reason} ->
|
||||
error({load_config_error, Reason});
|
||||
|
|
Loading…
Reference in New Issue