Mercurial > hg > nginx-tests
comparison h2.t @ 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 |
comparison
equal
deleted
inserted
replaced
759:6406eee6366c | 760:4db976a91540 |
---|---|
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; | 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; |
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; | 31 plan(skip_all => 'IO::Socket::SSL too old') if $@; |
32 | 32 |
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) | 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) |
34 ->has(qw/limit_conn rewrite realip shmem/) | 34 ->has(qw/limit_conn rewrite realip shmem/) |
35 ->has_daemon('openssl')->plan(247); | 35 ->has_daemon('openssl')->plan(249); |
36 | 36 |
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL | 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL |
38 | 38 |
39 $t->todo_alerts(); | 39 $t->todo_alerts(); |
40 | 40 |
390 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 390 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
391 ok($frame, 'GOAWAY invalid stream - GOAWAY frame'); | 391 ok($frame, 'GOAWAY invalid stream - GOAWAY frame'); |
392 is($frame->{code}, 1, 'GOAWAY invalid stream - GOAWAY PROTOCOL_ERROR'); | 392 is($frame->{code}, 1, 'GOAWAY invalid stream - GOAWAY PROTOCOL_ERROR'); |
393 | 393 |
394 } | 394 } |
395 | |
396 # client-initiated PUSH_PROMISE, just to ensure nothing went wrong | |
397 # N.B. other implementation returns zero code, which is not anyhow regulated | |
398 | |
399 $sess = new_session(); | |
400 raw_write($sess->{socket}, pack("x2C2xN", 4, 0x5, 1)); | |
401 $frames = h2_read($sess, all => [{ type => "GOAWAY" }]); | |
402 | |
403 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
404 ok($frame, 'client-initiated PUSH_PROMISE - GOAWAY frame'); | |
405 is($frame->{code}, 1, 'client-initiated PUSH_PROMISE - GOAWAY PROTOCOL_ERROR'); | |
395 | 406 |
396 # GET | 407 # GET |
397 | 408 |
398 $sess = new_session(); | 409 $sess = new_session(); |
399 my $sid = new_stream($sess); | 410 my $sid = new_stream($sess); |