test: fix test cases

This commit is contained in:
zhouzb 2022-01-13 14:27:36 +08:00
parent e2676bcbd8
commit 683d1c3412
2 changed files with 4 additions and 5 deletions

View File

@ -31,10 +31,10 @@
-define(PATH, [authentication]).
all() ->
[{group, require_seeds}, t_create, t_create_invalid, t_parse_query].
[{group, require_seeds}, t_create_invalid, t_parse_query].
groups() ->
[{require_seeds, [], [t_authenticate, t_update, t_destroy, t_is_superuser]}].
[{require_seeds, [], [t_create, t_authenticate, t_update, t_destroy, t_is_superuser]}].
init_per_testcase(_, Config) ->
{ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000),
@ -171,7 +171,7 @@ t_update(_Config) ->
IncorrectConfig =
CorrectConfig#{
query => <<"SELECT password_hash, salt, is_superuser_str as is_superuser
FROM wrong_table where username = ${username} LIMIT 1">>},
FROM users where username = ${username} LIMIT 0">>},
{ok, _} = emqx:update_config(
?PATH,

View File

@ -125,8 +125,7 @@ raw_pgsql_auth_config(SpecificSSLOpts) ->
username => <<"root">>,
password => <<"public">>,
query => <<"SELECT password_hash, salt, is_superuser_str as is_superuser
FROM users where username = ${username} LIMIT 1">>,
query => <<"SELECT 1">>,
server => pgsql_server(),
ssl => maps:merge(SSLOpts, SpecificSSLOpts)
}.