changeset 669:0c442e551ba1

Tests: corrected HTTP/2 tests for GOAWAY. In particular, unlike in SPDY, GOAWAY has a dedicated Last-Stream-ID field.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 02 Sep 2015 13:02:47 +0300
parents 1f34870e9538
children 944b87756cab
files h2.t
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -506,7 +506,7 @@ TODO: {
 local $TODO = 'not yet';
 
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
-isnt($frame, undef, 'updated table size - invalid index GOAWAY');
+ok($frame, 'updated table size - invalid index GOAWAY');
 
 }
 
@@ -1428,12 +1428,16 @@ new_stream($sess, { path => '/' }, 2);
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 ok($frame, 'even stream - GOAWAY frame');
 is($frame->{code}, 1, 'even stream - error code');
-is($frame->{sid}, 0, 'even stream - last used stream');
+is($frame->{last_sid}, 0, 'even stream - last stream');
 
 }
 
 # GOAWAY on SYN_STREAM with backward StreamID
 
+# 5.1.1.  Stream Identifiers
+#   The first use of a new stream identifier implicitly closes all
+#   streams in the "idle" state <..> with a lower-valued stream identifier.
+
 TODO: {
 local $TODO = 'not yet';
 
@@ -1447,11 +1451,11 @@ h2_read($sess, all => [{ sid => $sid, fi
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 ok($frame, 'backward stream - GOAWAY frame');
 is($frame->{code}, 1, 'backward stream - error code');
-is($frame->{sid}, $sid, 'backward stream - last used stream');
+is($frame->{last_sid}, $sid, 'backward stream - last stream');
 
 }
 
-# RST_STREAM on the second SYN_STREAM with same StreamID
+# GOAWAY on the second SYN_STREAM with same StreamID
 
 TODO: {
 local $TODO = 'not yet';
@@ -1461,12 +1465,12 @@ local $TODO = 'not yet';
 h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
 
 $sid2 = new_stream($sess, { path => '/' }, $sid);
-$frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]);
-
-($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
-ok($frame, 'dup stream - RST_STREAM frame');
+$frames = h2_read($sess, all => [{ type => 'GOAWAY' }]);
+
+($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
+ok($frame, 'dup stream - GOAWAY frame');
 is($frame->{code}, 1, 'dup stream - error code');
-is($frame->{sid}, $sid, 'dup stream - stream');
+is($frame->{last_sid}, $sid, 'dup stream - last stream');
 
 }