Mercurial > hg > nginx-tests
changeset 1506:c4c2275cda55
Tests: expect GOAWAY on HTTP/2 frames with dependency on itself.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 09 Sep 2019 17:16:00 +0300 |
parents | 76090a5da00b |
children | 8958b5b53c25 |
files | h2_priority.t |
diffstat | 1 files changed, 18 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/h2_priority.t +++ b/h2_priority.t @@ -206,18 +206,24 @@ is($sids, "$sid $sid2", 'dependency - PR # 5.3.1. Stream Dependencies # A stream cannot depend on itself. An endpoint MUST treat this as a # stream error of type PROTOCOL_ERROR. +# Instead, we respond with a connection error of type PROTOCOL_ERROR. + +TODO: { +local $TODO = 'not yet'; $s = Test::Nginx::HTTP2->new(); $sid = $s->new_stream(); $s->read(all => [{ sid => $sid, fin => 1 }]); $s->h2_priority(0, $sid, $sid); -$frames = $s->read(all => [{ type => 'RST_STREAM' }]); +$frames = $s->read(all => [{ type => 'GOAWAY' }]); -my ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; -is($frame->{sid}, $sid, 'dependency - PRIORITY self - RST_STREAM'); +my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +is($frame->{last_sid}, $sid, 'dependency - PRIORITY self - GOAWAY'); is($frame->{code}, 1, 'dependency - PRIORITY self - PROTOCOL_ERROR'); +} + # HEADERS PRIORITY flag, reprioritize prior PRIORITY frame records $s = Test::Nginx::HTTP2->new(); @@ -272,14 +278,19 @@ is($sids, "$sid $sid2", 'dependency - HE # HEADERS - self dependency +TODO: { +local $TODO = 'not yet'; + $s = Test::Nginx::HTTP2->new(); $sid = $s->new_stream({ dep => 1 }); -$frames = $s->read(all => [{ type => 'RST_STREAM' }]); +$frames = $s->read(all => [{ type => 'GOAWAY' }]); -($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; -is($frame->{sid}, $sid, 'dependency - HEADERS self - RST_STREAM'); +my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +is($frame->{last_sid}, 0, 'dependency - HEADERS self - GOAWAY'); is($frame->{code}, 1, 'dependency - HEADERS self - PROTOCOL_ERROR'); +} + # PRIORITY frame, weighted dependencies $s = Test::Nginx::HTTP2->new(); @@ -391,7 +402,7 @@ for (1 .. 40) { { sid => $sid3, fin => 1 }, ]); -($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; +my ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; is($frame->{length}, 81, 'removed dependency - first stream'); ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid3 } @$frames;