comparison h2_server_push.t @ 1280:8a88c0d6f80a

Tests: TODO HTTP/2 server push flow control tests with "aio on".
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 09 Feb 2018 10:11:14 +0300
parents da2ad1d72bb6
children 5bbade306a0d
comparison
equal deleted inserted replaced
1279:da2ad1d72bb6 1280:8a88c0d6f80a
265 $s->h2_settings(0, 0x3 => 0); 265 $s->h2_settings(0, 0x3 => 0);
266 $sid = $s->new_stream({ path => '/expl' }); 266 $sid = $s->new_stream({ path => '/expl' });
267 $frames = $s->read(all => [{ type => 'PUSH_PROMISE' }], wait => 0.2); 267 $frames = $s->read(all => [{ type => 'PUSH_PROMISE' }], wait => 0.2);
268 is(grep({ $_->{type} eq "PUSH_PROMISE" } @$frames), 0, 'max pushes disabled'); 268 is(grep({ $_->{type} eq "PUSH_PROMISE" } @$frames), 0, 'max pushes disabled');
269 269
270 TODO: {
271 local $TODO = 'not yet' if $t->read_file('nginx.conf') =~ /aio on/;
272
270 # server push flow control & rst 273 # server push flow control & rst
271 274
272 $s = Test::Nginx::HTTP2->new(); 275 $s = Test::Nginx::HTTP2->new();
273 $sid = $s->new_stream({ path => '/explf' }); 276 $sid = $s->new_stream({ path => '/explf' });
274 $frames = $s->read(all => [ 277 $frames = $s->read(all => [
301 304
302 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 2 } @$frames; 305 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 2 } @$frames;
303 is($frame->{length}, 1, 'pushed response flow control'); 306 is($frame->{length}, 1, 'pushed response flow control');
304 is($frame->{flags}, 1, 'pushed response END_STREAM'); 307 is($frame->{flags}, 1, 'pushed response END_STREAM');
305 308
309 }
310
306 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 4 } @$frames; 311 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 4 } @$frames;
307 ok(!$frame, 'rst pushed stream'); 312 ok(!$frame, 'rst pushed stream');
313
314 TODO: {
315 local $TODO = 'not yet' if $t->read_file('nginx.conf') =~ /aio on/;
308 316
309 # priority 317 # priority
310 318
311 $s = Test::Nginx::HTTP2->new(); 319 $s = Test::Nginx::HTTP2->new();
312 $sid = $s->new_stream({ path => '/prio' }); 320 $sid = $s->new_stream({ path => '/prio' });
333 $s->h2_window(2**17); 341 $s->h2_window(2**17);
334 342
335 $frames = $s->read(all => [{ sid => 2, fin => 1 }, { sid => 4, fin => 1 }]); 343 $frames = $s->read(all => [{ sid => 2, fin => 1 }, { sid => 4, fin => 1 }]);
336 @data = grep { $_->{type} eq "DATA" } @$frames; 344 @data = grep { $_->{type} eq "DATA" } @$frames;
337 is(join(' ', map { $_->{sid} } @data), "2 4", 'priority 2'); 345 is(join(' ', map { $_->{sid} } @data), "2 4", 'priority 2');
346
347 }
338 348
339 # http2_max_concurrent_pushes 349 # http2_max_concurrent_pushes
340 350
341 $s = Test::Nginx::HTTP2->new(port(8082)); 351 $s = Test::Nginx::HTTP2->new(port(8082));
342 $sid = $s->new_stream({ headers => [ 352 $sid = $s->new_stream({ headers => [