From 064f77ac3f11c4bf8d54a73a9d32ce7329d5caaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 12 Apr 2015 17:03:05 +0300 Subject: Improve existing spdy tests and add another --- test/spdy_SUITE.erl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/spdy_SUITE.erl') diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl index 28d9f7c..86167c5 100644 --- a/test/spdy_SUITE.erl +++ b/test/spdy_SUITE.erl @@ -43,7 +43,11 @@ do_req_resp(ConnPid, ServerPid, ServerStreamID) -> {syn_reply, ServerStreamID, false, <<"200">>, <<"HTTP/1.1">>, []}, {data, ServerStreamID, true, <<"Hello world!">>} ]), - _ = gun:await(ConnPid, StreamRef), + receive {gun_response, _, StreamRef, _, _, _} -> + ok + after 5000 -> + exit(timeout) + end, ok. streamid_is_odd(_) -> @@ -55,6 +59,16 @@ streamid_is_odd(_) -> Rec = spdy_server:stop(ServerPid), true = length(Rec) =:= length([ok || {syn_stream, StreamID, _, _, _, _, _, _, _, _, _, _} <- Rec, StreamID rem 2 =:= 1]). +reject_streamid_0(_) -> + doc("The Stream-ID 0 is not valid and must be rejected with a PROTOCOL_ERROR session error. (spdy-protocol-draft3-1 2.3.2)"), + {ok, ServerPid, Port} = spdy_server:start_link(), + {ok, ConnPid} = gun:open("localhost", Port, #{transport=>ssl}), + {ok, spdy} = gun:await_up(ConnPid), + StreamRef = gun:get(ConnPid, "/"), + spdy_server:send(ServerPid, [{syn_reply, 0, true, <<"200">>, <<"HTTP/1.1">>, []}]), + receive after 500 -> ok end, + [_, {goaway, 1, protocol_error}] = spdy_server:stop(ServerPid). + streamid_increases_monotonically(_) -> doc("The Stream-ID must increase monotonically. (spdy-protocol-draft3-1 2.3.2)"), {ok, ServerPid, Port} = spdy_server:start_link(), -- cgit v1.2.3