Fix testcase (#3216)

This commit is contained in:
JianBo He 2020-01-20 09:41:46 +08:00 committed by GitHub
parent 462e3974ad
commit 7ab3da399d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -93,7 +93,7 @@ t_info(_) ->
{'$gen_call', From, info} -> {'$gen_call', From, info} ->
gen_server:reply(From, emqx_connection:info(st())) gen_server:reply(From, emqx_connection:info(st()))
after after
0 -> error("error") 200 -> error("error")
end end
end), end),
#{sockinfo := SockInfo} = emqx_connection:info(CPid), #{sockinfo := SockInfo} = emqx_connection:info(CPid),

View File

@ -63,17 +63,17 @@ recv_and_check_presence(ClientId, Presence) ->
binary:split(Topic, <<"/">>, [global])), binary:split(Topic, <<"/">>, [global])),
case Presence of case Presence of
<<"connected">> -> <<"connected">> ->
?assertMatch(#{clientid := <<"clientid">>, ?assertMatch(#{<<"clientid">> := <<"clientid">>,
username := <<"username">>, <<"username">> := <<"username">>,
ipaddress := <<"127.0.0.1">>, <<"ipaddress">> := <<"127.0.0.1">>,
proto_name := <<"MQTT">>, <<"proto_name">> := <<"MQTT">>,
proto_ver := ?MQTT_PROTO_V4, <<"proto_ver">> := ?MQTT_PROTO_V4,
connack := ?RC_SUCCESS, <<"connack">> := ?RC_SUCCESS,
clean_start := true}, emqx_json:decode(Payload, [{labels, atom}, return_maps])); <<"clean_start">> := true}, emqx_json:decode(Payload, [return_maps]));
<<"disconnected">> -> <<"disconnected">> ->
?assertMatch(#{clientid := <<"clientid">>, ?assertMatch(#{<<"clientid">> := <<"clientid">>,
username := <<"username">>, <<"username">> := <<"username">>,
reason := <<"normal">>}, emqx_json:decode(Payload, [{labels, atom}, return_maps])) <<"reason">> := <<"normal">>}, emqx_json:decode(Payload, [return_maps]))
end. end.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------