Mercurial > hg > nginx-tests
comparison h2.t @ 668:1f34870e9538
Tests: removed TODOs for now passing HTTP/2 RST_STREAM tests.
This chases the latest HTTP/2 patch update with improved error handling.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 01 Sep 2015 15:13:09 +0300 |
parents | 0247e314e991 |
children | 0c442e551ba1 |
comparison
equal
deleted
inserted
replaced
667:0247e314e991 | 668:1f34870e9538 |
---|---|
1371 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 1'); | 1371 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 1'); |
1372 | 1372 |
1373 $sid2 = new_stream($sess, { path => '/t3.html' }); | 1373 $sid2 = new_stream($sess, { path => '/t3.html' }); |
1374 $frames = h2_read($sess, all => [{ sid => $sid2, fin => 0 }]); | 1374 $frames = h2_read($sess, all => [{ sid => $sid2, fin => 0 }]); |
1375 | 1375 |
1376 TODO: { | |
1377 local $TODO = 'not yet'; | |
1378 | |
1379 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; | 1376 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; |
1380 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 2'); | 1377 is($frame->{headers}->{':status'}, 200, 'RST_STREAM 2'); |
1381 | 1378 |
1382 } | |
1383 | |
1384 # http2_max_concurrent_streams | 1379 # http2_max_concurrent_streams |
1385 | 1380 |
1386 $sess = new_session(8086); | 1381 $sess = new_session(8086); |
1387 $frames = h2_read($sess, all => [{ type => 'SETTINGS' }]); | 1382 $frames = h2_read($sess, all => [{ type => 'SETTINGS' }]); |
1388 | 1383 |
1400 $sid2 = new_stream($sess, { path => '/t1.html' }); | 1395 $sid2 = new_stream($sess, { path => '/t1.html' }); |
1401 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); | 1396 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); |
1402 | 1397 |
1403 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; | 1398 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; |
1404 isnt($frame->{headers}->{':status'}, 200, 'http2_max_concurrent_streams 2'); | 1399 isnt($frame->{headers}->{':status'}, 200, 'http2_max_concurrent_streams 2'); |
1405 | |
1406 TODO: { | |
1407 local $TODO = 'not yet'; | |
1408 | 1400 |
1409 ($frame) = grep { $_->{type} eq "RST_STREAM" && $_->{sid} == $sid2 } @$frames; | 1401 ($frame) = grep { $_->{type} eq "RST_STREAM" && $_->{sid} == $sid2 } @$frames; |
1410 is($frame->{sid}, $sid2, 'http2_max_concurrent_streams RST_STREAM sid'); | 1402 is($frame->{sid}, $sid2, 'http2_max_concurrent_streams RST_STREAM sid'); |
1411 is($frame->{length}, 4, 'http2_max_concurrent_streams RST_STREAM length'); | 1403 is($frame->{length}, 4, 'http2_max_concurrent_streams RST_STREAM length'); |
1412 is($frame->{flags}, 0, 'http2_max_concurrent_streams RST_STREAM flags'); | 1404 is($frame->{flags}, 0, 'http2_max_concurrent_streams RST_STREAM flags'); |
1413 is($frame->{code}, 7, 'http2_max_concurrent_streams RST_STREAM code'); | 1405 is($frame->{code}, 7, 'http2_max_concurrent_streams RST_STREAM code'); |
1414 | |
1415 } | |
1416 | 1406 |
1417 h2_window($sess, 2**16, $sid); | 1407 h2_window($sess, 2**16, $sid); |
1418 h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | 1408 h2_read($sess, all => [{ sid => $sid, fin => 1 }]); |
1419 | 1409 |
1420 $sid = new_stream($sess, { path => '/t2.html' }); | 1410 $sid = new_stream($sess, { path => '/t2.html' }); |