comparison h2.t @ 794:fed83003c45c

Tests: one more HTTP/2 write handler test.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 04 Dec 2015 14:18:34 +0300
parents eb257a102a9b
children 43716ff7f8f5
comparison
equal deleted inserted replaced
793:ee7e07d826b8 794:fed83003c45c
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(291); 35 ->has_daemon('openssl')->plan(292);
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
1786 is($frame->{headers}->{':status'}, 200, 'large response - HEADERS'); 1786 is($frame->{headers}->{':status'}, 200, 'large response - HEADERS');
1787 1787
1788 @data = grep { $_->{type} eq "DATA" } @$frames; 1788 @data = grep { $_->{type} eq "DATA" } @$frames;
1789 $sum = eval join '+', map { $_->{length} } @data; 1789 $sum = eval join '+', map { $_->{length} } @data;
1790 is($sum, 5000000, 'large response - DATA'); 1790 is($sum, 5000000, 'large response - DATA');
1791
1792 # Make sure http2 write handler doesn't break a connection.
1793 # Some buggy systems tolerate ill-use of writev() triggered by write handler,
1794 # while others, such as darwin and NetBSD, follow POSIX strictly, which causes
1795 # a connection to close in nginx. While this also breaks the 'no alerts' test,
1796 # it doesn't suit well, because error.log is currently polluted with much more
1797 # alerts due to other various bugs in ngx_http_v2_module. We catch it here in
1798 # a separate test as well to make it clear.
1799
1800 SKIP: {
1801 skip 'tolerant operating system', 1 unless $^O eq 'darwin' or $^O eq 'netbsd';
1802
1803 TODO: {
1804 local $TODO = 'not yet';
1805
1806 $sid = new_stream($sess);
1807 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1808
1809 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1810 is($frame->{headers}->{':status'}, 200, 'new stream after large response');
1811
1812 }
1813
1814 }
1791 1815
1792 # write event send timeout 1816 # write event send timeout
1793 1817
1794 $sess = new_session(8091); 1818 $sess = new_session(8091);
1795 $sid = new_stream($sess, { path => '/tbig.html' }); 1819 $sid = new_stream($sess, { path => '/tbig.html' });