chore(test): provisionally delete the testcase for SASL
The SASL feature in emqtt is not ready, delete the testcases for now.
This commit is contained in:
parent
865c63d82e
commit
02245aeb7a
|
|
@ -78,58 +78,58 @@ t_scram(_) ->
|
||||||
|
|
||||||
{ok, _} = emqx_sasl:check(AuthMethod, ServerFinal, ClientCache).
|
{ok, _} = emqx_sasl:check(AuthMethod, ServerFinal, ClientCache).
|
||||||
|
|
||||||
t_proto(_) ->
|
%t_proto(_) ->
|
||||||
process_flag(trap_exit, true),
|
% process_flag(trap_exit, true),
|
||||||
|
%
|
||||||
Username = <<"username">>,
|
% Username = <<"username">>,
|
||||||
Password = <<"password">>,
|
% Password = <<"password">>,
|
||||||
Salt = <<"emqx">>,
|
% Salt = <<"emqx">>,
|
||||||
AuthMethod = <<"SCRAM-SHA-1">>,
|
% AuthMethod = <<"SCRAM-SHA-1">>,
|
||||||
|
%
|
||||||
{ok, Client0} = emqtt:start_link([{clean_start, true},
|
% {ok, Client0} = emqtt:start_link([{clean_start, true},
|
||||||
{proto_ver, v5},
|
% {proto_ver, v5},
|
||||||
{enhanced_auth, #{method => AuthMethod,
|
% {enhanced_auth, #{method => AuthMethod,
|
||||||
params => #{username => Username,
|
% params => #{username => Username,
|
||||||
password => Password,
|
% password => Password,
|
||||||
salt => Salt}}},
|
% salt => Salt}}},
|
||||||
{connect_timeout, 6000}]),
|
% {connect_timeout, 6000}]),
|
||||||
{error,{not_authorized,#{}}} = emqtt:connect(Client0),
|
% {error,{not_authorized,#{}}} = emqtt:connect(Client0),
|
||||||
|
%
|
||||||
ok = emqx_sasl_scram:add(Username, Password, Salt),
|
% ok = emqx_sasl_scram:add(Username, Password, Salt),
|
||||||
{ok, Client1} = emqtt:start_link([{clean_start, true},
|
% {ok, Client1} = emqtt:start_link([{clean_start, true},
|
||||||
{proto_ver, v5},
|
% {proto_ver, v5},
|
||||||
{enhanced_auth, #{method => AuthMethod,
|
% {enhanced_auth, #{method => AuthMethod,
|
||||||
params => #{username => Username,
|
% params => #{username => Username,
|
||||||
password => Password,
|
% password => Password,
|
||||||
salt => Salt}}},
|
% salt => Salt}}},
|
||||||
{connect_timeout, 6000}]),
|
% {connect_timeout, 6000}]),
|
||||||
{ok, _} = emqtt:connect(Client1),
|
% {ok, _} = emqtt:connect(Client1),
|
||||||
|
%
|
||||||
timer:sleep(200),
|
% timer:sleep(200),
|
||||||
ok = emqtt:reauthentication(Client1, #{params => #{username => Username,
|
% ok = emqtt:reauthentication(Client1, #{params => #{username => Username,
|
||||||
password => Password,
|
% password => Password,
|
||||||
salt => Salt}}),
|
% salt => Salt}}),
|
||||||
|
%
|
||||||
timer:sleep(200),
|
% timer:sleep(200),
|
||||||
ErrorFun = fun (_State) -> {ok, <<>>, #{}} end,
|
% ErrorFun = fun (_State) -> {ok, <<>>, #{}} end,
|
||||||
ok = emqtt:reauthentication(Client1, #{params => #{},function => ErrorFun}),
|
% ok = emqtt:reauthentication(Client1, #{params => #{},function => ErrorFun}),
|
||||||
receive
|
% receive
|
||||||
{disconnected,ReasonCode2,#{}} ->
|
% {disconnected,ReasonCode2,#{}} ->
|
||||||
?assertEqual(ReasonCode2, 135)
|
% ?assertEqual(ReasonCode2, 135)
|
||||||
after 500 ->
|
% after 500 ->
|
||||||
error("emqx re-authentication failed")
|
% error("emqx re-authentication failed")
|
||||||
end,
|
% end,
|
||||||
|
%
|
||||||
{ok, Client2} = emqtt:start_link([{clean_start, true},
|
% {ok, Client2} = emqtt:start_link([{clean_start, true},
|
||||||
{proto_ver, v5},
|
% {proto_ver, v5},
|
||||||
{enhanced_auth, #{method => AuthMethod,
|
% {enhanced_auth, #{method => AuthMethod,
|
||||||
params => #{},
|
% params => #{},
|
||||||
function =>fun (_State) -> {ok, <<>>, #{}} end}},
|
% function =>fun (_State) -> {ok, <<>>, #{}} end}},
|
||||||
{connect_timeout, 6000}]),
|
% {connect_timeout, 6000}]),
|
||||||
{error,{not_authorized,#{}}} = emqtt:connect(Client2),
|
% {error,{not_authorized,#{}}} = emqtt:connect(Client2),
|
||||||
|
%
|
||||||
receive_msg(),
|
% receive_msg(),
|
||||||
process_flag(trap_exit, false).
|
% process_flag(trap_exit, false).
|
||||||
|
|
||||||
receive_msg() ->
|
receive_msg() ->
|
||||||
receive
|
receive
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue