comparison h2.t @ 841:6a401b5fa812

Tests: check timed out HTTP/2 streams for proper RST_STREAM code.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 02 Feb 2016 18:12:51 +0300
parents ecffe6c23a14
children 60b3e0cfba77
comparison
equal deleted inserted replaced
840:ecffe6c23a14 841:6a401b5fa812
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(302); 35 ->has_daemon('openssl')->plan(304);
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
1531 split_delay => 2.1 }); 1531 split_delay => 2.1 });
1532 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); 1532 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]);
1533 1533
1534 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; 1534 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
1535 ok($frame, 'client header timeout'); 1535 ok($frame, 'client header timeout');
1536 is($frame->{code}, 1, 'client header timeout - protocol error');
1536 1537
1537 } 1538 }
1538 1539
1539 h2_ping($sess, 'SEE-THIS'); 1540 h2_ping($sess, 'SEE-THIS');
1540 $frames = h2_read($sess, all => [{ type => 'PING' }]); 1541 $frames = h2_read($sess, all => [{ type => 'PING' }]);
1552 split => [67], split_delay => 2.1 }); 1553 split => [67], split_delay => 2.1 });
1553 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); 1554 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]);
1554 1555
1555 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; 1556 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
1556 ok($frame, 'client body timeout'); 1557 ok($frame, 'client body timeout');
1558 is($frame->{code}, 1, 'client body timeout - protocol error');
1557 1559
1558 } 1560 }
1559 1561
1560 h2_ping($sess, 'SEE-THIS'); 1562 h2_ping($sess, 'SEE-THIS');
1561 $frames = h2_read($sess, all => [{ type => 'PING' }]); 1563 $frames = h2_read($sess, all => [{ type => 'PING' }]);