aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-04-12 17:03:05 +0300
committerLoïc Hoguin <[email protected]>2015-04-12 17:03:05 +0300
commit064f77ac3f11c4bf8d54a73a9d32ce7329d5caaf (patch)
treea8b49636bb313c6cba098dbb6a783b03fcc2534b /test
parent8d15999e1c4e74a4e76dbf79c7123ecb2190443f (diff)
downloadgun-064f77ac3f11c4bf8d54a73a9d32ce7329d5caaf.tar.gz
gun-064f77ac3f11c4bf8d54a73a9d32ce7329d5caaf.tar.bz2
gun-064f77ac3f11c4bf8d54a73a9d32ce7329d5caaf.zip
Improve existing spdy tests and add another
Diffstat (limited to 'test')
-rw-r--r--test/spdy_SUITE.erl16
1 files changed, 15 insertions, 1 deletions
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(),