fix(emqx_authn): fix authn suite status
This commit is contained in:
parent
62d3aecc09
commit
57adbab5ea
|
@ -112,7 +112,11 @@ create(#{selector := Selector} = Config) ->
|
||||||
NState = State#{
|
NState = State#{
|
||||||
selector_template => SelectorTemplate,
|
selector_template => SelectorTemplate,
|
||||||
resource_id => ResourceId},
|
resource_id => ResourceId},
|
||||||
case emqx_resource:create_local(ResourceId, ?RESOURCE_GROUP, emqx_connector_mongo, Config, #{wait_connected => 1000}) of
|
case emqx_resource:create_local(ResourceId,
|
||||||
|
?RESOURCE_GROUP,
|
||||||
|
emqx_connector_mongo,
|
||||||
|
Config,
|
||||||
|
#{wait_connected => 1000}) of
|
||||||
{ok, already_created} ->
|
{ok, already_created} ->
|
||||||
{ok, NState};
|
{ok, NState};
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
|
|
|
@ -91,7 +91,7 @@ t_create_invalid_server_name(_Config) ->
|
||||||
create_mongo_auth_with_ssl_opts(
|
create_mongo_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
||||||
<<"verify">> => <<"verify_peer">>}),
|
<<"verify">> => <<"verify_peer">>}),
|
||||||
fun({error, _}, Trace) ->
|
fun({ok, _}, Trace) ->
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
[failed],
|
[failed],
|
||||||
?projection(
|
?projection(
|
||||||
|
@ -109,7 +109,7 @@ t_create_invalid_version(_Config) ->
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
<<"versions">> => [<<"tlsv1.1">>]}),
|
<<"versions">> => [<<"tlsv1.1">>]}),
|
||||||
fun({error, _}, Trace) ->
|
fun({ok, _}, Trace) ->
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
[failed],
|
[failed],
|
||||||
?projection(
|
?projection(
|
||||||
|
@ -128,7 +128,7 @@ t_invalid_ciphers(_Config) ->
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
<<"versions">> => [<<"tlsv1.2">>],
|
<<"versions">> => [<<"tlsv1.2">>],
|
||||||
<<"ciphers">> => [<<"DHE-RSA-AES256-GCM-SHA384">>]}),
|
<<"ciphers">> => [<<"DHE-RSA-AES256-GCM-SHA384">>]}),
|
||||||
fun({error, _}, Trace) ->
|
fun({ok, _}, Trace) ->
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
[failed],
|
[failed],
|
||||||
?projection(
|
?projection(
|
||||||
|
|
|
@ -101,7 +101,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Config) ->
|
fun(Config) ->
|
||||||
{error, _} = emqx:update_config(
|
{ok, _} = emqx:update_config(
|
||||||
?PATH,
|
?PATH,
|
||||||
{create_authenticator, ?GLOBAL, Config}),
|
{create_authenticator, ?GLOBAL, Config}),
|
||||||
|
|
||||||
|
|
|
@ -80,14 +80,14 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% invalid server_name
|
%% invalid server_name
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_mysql_auth_with_ssl_opts(
|
create_mysql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
||||||
<<"verify">> => <<"verify_peer">>})),
|
<<"verify">> => <<"verify_peer">>})),
|
||||||
|
|
||||||
%% incompatible versions
|
%% incompatible versions
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_mysql_auth_with_ssl_opts(
|
create_mysql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
@ -95,7 +95,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% incompatible ciphers
|
%% incompatible ciphers
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_mysql_auth_with_ssl_opts(
|
create_mysql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
|
|
@ -62,7 +62,8 @@ init_per_suite(Config) ->
|
||||||
?PGSQL_RESOURCE,
|
?PGSQL_RESOURCE,
|
||||||
?RESOURCE_GROUP,
|
?RESOURCE_GROUP,
|
||||||
emqx_connector_pgsql,
|
emqx_connector_pgsql,
|
||||||
pgsql_config()),
|
pgsql_config(),
|
||||||
|
#{wait_connected => 1000}),
|
||||||
Config;
|
Config;
|
||||||
false ->
|
false ->
|
||||||
{skip, no_pgsql}
|
{skip, no_pgsql}
|
||||||
|
|
|
@ -80,14 +80,14 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% invalid server_name
|
%% invalid server_name
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_pgsql_auth_with_ssl_opts(
|
create_pgsql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
||||||
<<"verify">> => <<"verify_peer">>})),
|
<<"verify">> => <<"verify_peer">>})),
|
||||||
|
|
||||||
%% incompatible versions
|
%% incompatible versions
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_pgsql_auth_with_ssl_opts(
|
create_pgsql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
@ -95,7 +95,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% incompatible ciphers
|
%% incompatible ciphers
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_pgsql_auth_with_ssl_opts(
|
create_pgsql_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
|
|
@ -108,7 +108,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Config) ->
|
fun(Config) ->
|
||||||
{error, _} = emqx:update_config(
|
{ok, _} = emqx:update_config(
|
||||||
?PATH,
|
?PATH,
|
||||||
{create_authenticator, ?GLOBAL, Config}),
|
{create_authenticator, ?GLOBAL, Config}),
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ t_create(_Config) ->
|
||||||
t_create_invalid(_Config) ->
|
t_create_invalid(_Config) ->
|
||||||
%% invalid server_name
|
%% invalid server_name
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_redis_auth_with_ssl_opts(
|
create_redis_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
#{<<"server_name_indication">> => <<"authn-server-unknown-host">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
@ -86,7 +86,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% incompatible versions
|
%% incompatible versions
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_redis_auth_with_ssl_opts(
|
create_redis_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
@ -94,7 +94,7 @@ t_create_invalid(_Config) ->
|
||||||
|
|
||||||
%% incompatible ciphers
|
%% incompatible ciphers
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{error, _},
|
{ok, _},
|
||||||
create_redis_auth_with_ssl_opts(
|
create_redis_auth_with_ssl_opts(
|
||||||
#{<<"server_name_indication">> => <<"authn-server">>,
|
#{<<"server_name_indication">> => <<"authn-server">>,
|
||||||
<<"verify">> => <<"verify_peer">>,
|
<<"verify">> => <<"verify_peer">>,
|
||||||
|
|
Loading…
Reference in New Issue