aboutsummaryrefslogtreecommitdiffstats
path: root/test/spdy_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-04-13 12:23:59 +0300
committerLoïc Hoguin <[email protected]>2015-04-13 12:23:59 +0300
commit9b65246e55af95ace39befb90a8e5a0238830185 (patch)
tree31af1ca7deb7877413504319e4d987f9f5028cba /test/spdy_SUITE.erl
parent476147d068a281d456b2748cae7cd7537ec4b37a (diff)
downloadgun-9b65246e55af95ace39befb90a8e5a0238830185.tar.gz
gun-9b65246e55af95ace39befb90a8e5a0238830185.tar.bz2
gun-9b65246e55af95ace39befb90a8e5a0238830185.zip
One more SPDY test
Diffstat (limited to 'test/spdy_SUITE.erl')
-rw-r--r--test/spdy_SUITE.erl23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl
index 44fbbbe..b5a5666 100644
--- a/test/spdy_SUITE.erl
+++ b/test/spdy_SUITE.erl
@@ -29,12 +29,19 @@ wait() ->
receive after 500 -> ok end.
down() ->
- receive {gun_down, ConnPid, _, _, _, _} ->
+ receive {gun_down, _, _, _, _, _} ->
ok
after 5000 ->
exit(timeout)
end.
+not_down() ->
+ receive {gun_down, _, _, _, _, _} ->
+ exit(down)
+ after 0 ->
+ ok
+ end.
+
do_req_resp(ConnPid, ServerPid, ServerStreamID) ->
StreamRef = gun:get(ConnPid, "/"),
spdy_server:send(ServerPid, [
@@ -280,3 +287,17 @@ goaway_last_good_streamid(_) ->
wait(),
[{goaway, 6, protocol_error}] = spdy_server:stop(ServerPid),
down().
+
+dont_send_rst_stream_on_rst_stream(_) ->
+ doc("An endpoint must not send an RST_STREAM in response to an RST_STREAM. (spdy-protocol-draft3-1 2.4.2)"),
+ {ok, ServerPid, Port} = spdy_server:start_link(),
+ {ok, ConnPid} = gun:open("localhost", Port, #{transport=>ssl}),
+ {ok, spdy} = gun:await_up(ConnPid),
+ _ = gun:get(ConnPid, "/"),
+ spdy_server:send(ServerPid, [
+ {rst_stream, 1, refused_stream}
+ ]),
+ wait(),
+ %% No RST_STREAM was received; only SYN_STREAM.
+ [_] = spdy_server:stop(ServerPid),
+ not_down().