comparison h2.t @ 761:01feb5d4d7a4

Tests: HTTP/2 test for CONTINUATION on a closed stream.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 28 Oct 2015 00:11:45 +0300
parents 4db976a91540
children f28debc81182
comparison
equal deleted inserted replaced
760:4db976a91540 761:01feb5d4d7a4
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(249); 35 ->has_daemon('openssl')->plan(251);
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
1022 { name => ':authority', value => 'localhost', mode => 1 }]}); 1022 { name => ':authority', value => 'localhost', mode => 1 }]});
1023 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 1023 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1024 1024
1025 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 1025 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1026 is($frame->{headers}->{':status'}, 200, 'CONTINUATION - in header field'); 1026 is($frame->{headers}->{':status'}, 200, 'CONTINUATION - in header field');
1027
1028 # CONTINUATION on a closed stream
1029
1030 h2_continue($sess, 1, { headers => [
1031 { name => 'x-foo', value => 'X-Bar', mode => 2 }]});
1032 $frames = h2_read($sess, all => [{ sid => 1, fin => 1 }]);
1033
1034 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
1035 is($frame->{type}, 'GOAWAY', 'GOAWAY - CONTINUATION closed stream');
1036 is($frame->{code}, 1, 'GOAWAY - CONTINUATION closed stream - PROTOCOL_ERROR');
1027 1037
1028 # frame padding 1038 # frame padding
1029 1039
1030 $sess = new_session(); 1040 $sess = new_session();
1031 $sid = new_stream($sess, { padding => 42, headers => [ 1041 $sid = new_stream($sess, { padding => 42, headers => [