Fix bugs in test cases

This commit is contained in:
周子博 2018-10-26 14:34:22 +08:00
parent ffa220a87d
commit e56252dac6
2 changed files with 18 additions and 10 deletions

View File

@ -46,14 +46,15 @@ init([ClientId]) ->
}.
handle_call({start_session, ClientPid, ClientId, Zone}, _From, State) ->
Attrs = #{ zone => Zone,
client_id => ClientId,
conn_pid => ClientPid,
clean_start => true,
username => undefined,
expiry_interval => 0,
max_inflight => 0,
topic_alias_maximum => 0
Attrs = #{ zone => Zone,
client_id => ClientId,
conn_pid => ClientPid,
clean_start => true,
username => undefined,
expiry_interval => 0,
max_inflight => 0,
topic_alias_maximum => 0,
will_msg => undefined
},
{ok, SessPid} = emqx_sm:open_session(Attrs),
{reply, {ok, SessPid},

View File

@ -24,8 +24,15 @@ all() -> [t_open_close_session].
t_open_close_session(_) ->
emqx_ct_broker_helpers:run_setup_steps(),
{ok, ClientPid} = emqx_mock_client:start_link(<<"client">>),
Attrs = #{clean_start => true, client_id => <<"client">>, conn_pid => ClientPid,
zone => internal, username => <<"zhou">>, expiry_interval => 0, max_inflight => 0, topic_alias_maximum => 0},
Attrs = #{clean_start => true,
client_id => <<"client">>,
conn_pid => ClientPid,
zone => internal,
username => <<"zhou">>,
expiry_interval => 0,
max_inflight => 0,
topic_alias_maximum => 0,
will_msg => undefined},
{ok, SPid} = emqx_sm:open_session(Attrs),
[{<<"client">>, SPid}] = emqx_sm:lookup_session(<<"client">>),
SPid = emqx_sm:lookup_session_pid(<<"client">>),