test: fix test cases
This commit is contained in:
parent
e2676bcbd8
commit
683d1c3412
|
@ -31,10 +31,10 @@
|
||||||
-define(PATH, [authentication]).
|
-define(PATH, [authentication]).
|
||||||
|
|
||||||
all() ->
|
all() ->
|
||||||
[{group, require_seeds}, t_create, t_create_invalid, t_parse_query].
|
[{group, require_seeds}, t_create_invalid, t_parse_query].
|
||||||
|
|
||||||
groups() ->
|
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) ->
|
init_per_testcase(_, Config) ->
|
||||||
{ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000),
|
{ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000),
|
||||||
|
@ -171,7 +171,7 @@ t_update(_Config) ->
|
||||||
IncorrectConfig =
|
IncorrectConfig =
|
||||||
CorrectConfig#{
|
CorrectConfig#{
|
||||||
query => <<"SELECT password_hash, salt, is_superuser_str as is_superuser
|
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(
|
{ok, _} = emqx:update_config(
|
||||||
?PATH,
|
?PATH,
|
||||||
|
|
|
@ -125,8 +125,7 @@ raw_pgsql_auth_config(SpecificSSLOpts) ->
|
||||||
username => <<"root">>,
|
username => <<"root">>,
|
||||||
password => <<"public">>,
|
password => <<"public">>,
|
||||||
|
|
||||||
query => <<"SELECT password_hash, salt, is_superuser_str as is_superuser
|
query => <<"SELECT 1">>,
|
||||||
FROM users where username = ${username} LIMIT 1">>,
|
|
||||||
server => pgsql_server(),
|
server => pgsql_server(),
|
||||||
ssl => maps:merge(SSLOpts, SpecificSSLOpts)
|
ssl => maps:merge(SSLOpts, SpecificSSLOpts)
|
||||||
}.
|
}.
|
||||||
|
|
Loading…
Reference in New Issue