test: fix test cases for pgsql authz
This commit is contained in:
parent
683d1c3412
commit
5e2bc7853f
|
@ -167,7 +167,7 @@ t_pgsql_error(_Config) ->
|
||||||
listener => {tcp, default}
|
listener => {tcp, default}
|
||||||
},
|
},
|
||||||
|
|
||||||
ok = setup_config(
|
{error, _} = setup_config(
|
||||||
#{<<"query">> => <<"SOME INVALID STATEMENT">>}),
|
#{<<"query">> => <<"SOME INVALID STATEMENT">>}),
|
||||||
|
|
||||||
ok = emqx_authz_test_lib:test_samples(
|
ok = emqx_authz_test_lib:test_samples(
|
||||||
|
|
|
@ -40,8 +40,10 @@ reset_authorizers(Nomatch, ChacheEnabled) ->
|
||||||
|
|
||||||
setup_config(BaseConfig, SpecialParams) ->
|
setup_config(BaseConfig, SpecialParams) ->
|
||||||
Config = maps:merge(BaseConfig, SpecialParams),
|
Config = maps:merge(BaseConfig, SpecialParams),
|
||||||
{ok, _} = emqx_authz:update(?CMD_REPLACE, [Config]),
|
case emqx_authz:update(?CMD_REPLACE, [Config]) of
|
||||||
ok.
|
{ok, _} -> ok;
|
||||||
|
{error, Reason} -> {error, Reason}
|
||||||
|
end.
|
||||||
|
|
||||||
is_tcp_server_available(Host, Port) ->
|
is_tcp_server_available(Host, Port) ->
|
||||||
case gen_tcp:connect(Host, Port, [], ?DEFAULT_CHECK_AVAIL_TIMEOUT) of
|
case gen_tcp:connect(Host, Port, [], ?DEFAULT_CHECK_AVAIL_TIMEOUT) of
|
||||||
|
|
Loading…
Reference in New Issue