changeset 760:4db976a91540

Tests: HTTP/2 tests for client-initiated PUSH_PROMISE.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 28 Oct 2015 00:11:44 +0300
parents 6406eee6366c
children 01feb5d4d7a4
files h2.t
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
 	->has(qw/limit_conn rewrite realip shmem/)
-	->has_daemon('openssl')->plan(247);
+	->has_daemon('openssl')->plan(249);
 
 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
 
@@ -393,6 +393,17 @@ is($frame->{code}, 1, 'GOAWAY invalid st
 
 }
 
+# client-initiated PUSH_PROMISE, just to ensure nothing went wrong
+# N.B. other implementation returns zero code, which is not anyhow regulated
+
+$sess = new_session();
+raw_write($sess->{socket}, pack("x2C2xN", 4, 0x5, 1));
+$frames = h2_read($sess, all => [{ type => "GOAWAY" }]);
+
+($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
+ok($frame, 'client-initiated PUSH_PROMISE - GOAWAY frame');
+is($frame->{code}, 1, 'client-initiated PUSH_PROMISE - GOAWAY PROTOCOL_ERROR');
+
 # GET
 
 $sess = new_session();