Skip to content

Commit

Permalink
test: add tc_shutdown_conn_before_handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Oct 23, 2024
1 parent a2b841f commit 5df80fa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/quicer_connection_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,25 @@ tc_get_conn_owner_server(Config) ->
ct:fail({client_fail, Reason})
end.

tc_shutdown_conn_before_handshake(Config) ->
Port = select_port(),
{ok, L} = quicer:listen(Port, default_listen_opts(Config)),
{ok, L} = quicer:async_accept(L, #{}),
CPid = spawn(fun() ->
_ = quicer:connect("localhost", Port, default_conn_opts(), 1000),
receive
done -> ok
end
end),
receive
{quic, new_conn, Conn, _} ->
Res = quicer:shutdown_connection(Conn),
CPid ! done,
?assertEqual(ok, Res)
after 1000 ->
ct:fail("conn from client timeout")
end.

%%%
%%% Helpers
%%%
Expand Down

0 comments on commit 5df80fa

Please sign in to comment.