From 683d1c3412ce24756e60af9c00a9b3c62289de60 Mon Sep 17 00:00:00 2001 From: zhouzb Date: Thu, 13 Jan 2022 14:27:36 +0800 Subject: [PATCH] test: fix test cases --- apps/emqx_authn/test/emqx_authn_pgsql_SUITE.erl | 6 +++--- apps/emqx_authn/test/emqx_authn_pgsql_tls_SUITE.erl | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/emqx_authn/test/emqx_authn_pgsql_SUITE.erl b/apps/emqx_authn/test/emqx_authn_pgsql_SUITE.erl index bfccaf128..a2c95314d 100644 --- a/apps/emqx_authn/test/emqx_authn_pgsql_SUITE.erl +++ b/apps/emqx_authn/test/emqx_authn_pgsql_SUITE.erl @@ -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, diff --git a/apps/emqx_authn/test/emqx_authn_pgsql_tls_SUITE.erl b/apps/emqx_authn/test/emqx_authn_pgsql_tls_SUITE.erl index 51a1ce8dd..0225ed06f 100644 --- a/apps/emqx_authn/test/emqx_authn_pgsql_tls_SUITE.erl +++ b/apps/emqx_authn/test/emqx_authn_pgsql_tls_SUITE.erl @@ -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) }.