comparison h2.t @ 765:14d6f69b7d9d

Tests: added HTTP/2 proxy cache tests for empty DATA frame.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 28 Oct 2015 00:11:46 +0300
parents 5dcd998daace
children a764054d457f
comparison
equal deleted inserted replaced
764:5dcd998daace 765:14d6f69b7d9d
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(276); 35 ->has_daemon('openssl')->plan(279);
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
1333 $sid = new_stream($sess, { path => '/cache/t2.html?1', method => 'HEAD' }); 1333 $sid = new_stream($sess, { path => '/cache/t2.html?1', method => 'HEAD' });
1334 1334
1335 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 1335 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1336 push @$frames, $_ for @{h2_read($sess, all => [{ sid => $sid }])}; 1336 push @$frames, $_ for @{h2_read($sess, all => [{ sid => $sid }])};
1337 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body'); 1337 ok(!grep ({ $_->{type} eq "DATA" } @$frames), 'proxy cache HEAD - no body');
1338
1339 # proxy cache - expect no stray empty DATA frame
1340
1341 TODO: {
1342 local $TODO = 'not yet';
1343
1344 $sess = new_session();
1345 $sid = new_stream($sess, { path => '/cache/t2.html?2' });
1346
1347 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1348 @data = grep ({ $_->{type} eq "DATA" } @$frames);
1349 is(@data, 1, 'proxy cache write - data frames');
1350 is(join(' ', map { $_->{data} } @data), 'SEE-THIS', 'proxy cache write - data');
1351 is(join(' ', map { $_->{flags} } @data), '1', 'proxy cache write - flags');
1352
1353 }
1338 1354
1339 # HEAD on empty cache with proxy_buffering off 1355 # HEAD on empty cache with proxy_buffering off
1340 1356
1341 $sess = new_session(); 1357 $sess = new_session();
1342 $sid = new_stream($sess, 1358 $sid = new_stream($sess,