Mercurial > hg > nginx-tests
comparison h2.t @ 1020:196d33c2bb45
Tests: removed TODO and try_run() checks for legacy versions.
Also removed now unused spdy.t and shmem prerequisite.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Wed, 31 Aug 2016 18:21:07 +0300 |
parents | 3b1ee8acc4db |
children | 2d4343a47c6d |
comparison
equal
deleted
inserted
replaced
1019:41139d6f8b7b | 1020:196d33c2bb45 |
---|---|
449 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | 449 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; |
450 is($frame->{headers}->{':status'}, 200, 'padding - next stream'); | 450 is($frame->{headers}->{':status'}, 200, 'padding - next stream'); |
451 | 451 |
452 # padding followed by CONTINUATION | 452 # padding followed by CONTINUATION |
453 | 453 |
454 TODO: { | |
455 local $TODO = 'not yet' unless $t->has_version('1.9.11'); | |
456 | |
457 $s = Test::Nginx::HTTP2->new(); | 454 $s = Test::Nginx::HTTP2->new(); |
458 $sid = $s->new_stream({ padding => 42, continuation => [ 2, 4, 1, 5 ], | 455 $sid = $s->new_stream({ padding => 42, continuation => [ 2, 4, 1, 5 ], |
459 headers => [ | 456 headers => [ |
460 { name => ':method', value => 'GET', mode => 1 }, | 457 { name => ':method', value => 'GET', mode => 1 }, |
461 { name => ':scheme', value => 'http', mode => 0 }, | 458 { name => ':scheme', value => 'http', mode => 0 }, |
463 { name => ':authority', value => 'localhost', mode => 1 }]}); | 460 { name => ':authority', value => 'localhost', mode => 1 }]}); |
464 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); | 461 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); |
465 | 462 |
466 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | 463 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; |
467 is($frame->{headers}->{':status'}, 200, 'padding - CONTINUATION'); | 464 is($frame->{headers}->{':status'}, 200, 'padding - CONTINUATION'); |
468 | |
469 } | |
470 | 465 |
471 # internal redirect | 466 # internal redirect |
472 | 467 |
473 $s = Test::Nginx::HTTP2->new(); | 468 $s = Test::Nginx::HTTP2->new(); |
474 $sid = $s->new_stream({ path => '/redirect' }); | 469 $sid = $s->new_stream({ path => '/redirect' }); |
623 is($frame->{headers}->{'content-type'}, 'text/plain; charset=utf-8', 'charset'); | 618 is($frame->{headers}->{'content-type'}, 'text/plain; charset=utf-8', 'charset'); |
624 | 619 |
625 # partial request header frame received (field split), | 620 # partial request header frame received (field split), |
626 # the rest of frame is received after client header timeout | 621 # the rest of frame is received after client header timeout |
627 | 622 |
628 TODO: { | |
629 local $TODO = 'not yet' unless $t->has_version('1.9.12'); | |
630 | |
631 $s = Test::Nginx::HTTP2->new(port(8087)); | 623 $s = Test::Nginx::HTTP2->new(port(8087)); |
632 $sid = $s->new_stream({ path => '/t2.html', split => [35], | 624 $sid = $s->new_stream({ path => '/t2.html', split => [35], |
633 split_delay => 2.1 }); | 625 split_delay => 2.1 }); |
634 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); | 626 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); |
635 | 627 |
636 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; | 628 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; |
637 ok($frame, 'client header timeout'); | 629 ok($frame, 'client header timeout'); |
638 is($frame->{code}, 1, 'client header timeout - protocol error'); | 630 is($frame->{code}, 1, 'client header timeout - protocol error'); |
639 | 631 |
640 } | |
641 | |
642 $s->h2_ping('SEE-THIS'); | 632 $s->h2_ping('SEE-THIS'); |
643 $frames = $s->read(all => [{ type => 'PING' }]); | 633 $frames = $s->read(all => [{ type => 'PING' }]); |
644 | 634 |
645 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; | 635 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; |
646 ok($frame, 'client header timeout - PING'); | 636 ok($frame, 'client header timeout - PING'); |
647 | 637 |
648 # partial request body data frame received, the rest is after body timeout | 638 # partial request body data frame received, the rest is after body timeout |
649 | |
650 TODO: { | |
651 local $TODO = 'not yet' unless $t->has_version('1.9.12'); | |
652 | 639 |
653 $s = Test::Nginx::HTTP2->new(port(8087)); | 640 $s = Test::Nginx::HTTP2->new(port(8087)); |
654 $sid = $s->new_stream({ path => '/proxy/t2.html', body_more => 1 }); | 641 $sid = $s->new_stream({ path => '/proxy/t2.html', body_more => 1 }); |
655 $s->h2_body('TEST', { split => [10], split_delay => 2.1 }); | 642 $s->h2_body('TEST', { split => [10], split_delay => 2.1 }); |
656 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); | 643 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); |
657 | 644 |
658 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; | 645 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; |
659 ok($frame, 'client body timeout'); | 646 ok($frame, 'client body timeout'); |
660 is($frame->{code}, 1, 'client body timeout - protocol error'); | 647 is($frame->{code}, 1, 'client body timeout - protocol error'); |
661 | 648 |
662 } | |
663 | |
664 $s->h2_ping('SEE-THIS'); | 649 $s->h2_ping('SEE-THIS'); |
665 $frames = $s->read(all => [{ type => 'PING' }]); | 650 $frames = $s->read(all => [{ type => 'PING' }]); |
666 | 651 |
667 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; | 652 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; |
668 ok($frame, 'client body timeout - PING'); | 653 ok($frame, 'client body timeout - PING'); |
669 | |
670 | 654 |
671 # proxied request with logging pristine request header field (e.g., referer) | 655 # proxied request with logging pristine request header field (e.g., referer) |
672 | 656 |
673 $s = Test::Nginx::HTTP2->new(); | 657 $s = Test::Nginx::HTTP2->new(); |
674 $sid = $s->new_stream({ headers => [ | 658 $sid = $s->new_stream({ headers => [ |