Mercurial > hg > nginx-tests
comparison h2_priority.t @ 1693:5ac6efbe5552
Tests: removed TODO and try_run() checks for legacy versions.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 01 Jun 2021 16:40:18 +0300 |
parents | 48306d8a2811 |
children | 236d038dc04a |
comparison
equal
deleted
inserted
replaced
1692:f6795e2e6a4b | 1693:5ac6efbe5552 |
---|---|
206 # 5.3.1. Stream Dependencies | 206 # 5.3.1. Stream Dependencies |
207 # A stream cannot depend on itself. An endpoint MUST treat this as a | 207 # A stream cannot depend on itself. An endpoint MUST treat this as a |
208 # stream error of type PROTOCOL_ERROR. | 208 # stream error of type PROTOCOL_ERROR. |
209 # Instead, we respond with a connection error of type PROTOCOL_ERROR. | 209 # Instead, we respond with a connection error of type PROTOCOL_ERROR. |
210 | 210 |
211 TODO: { | |
212 local $TODO = 'not yet' unless $t->has_version('1.17.4'); | |
213 | |
214 $s = Test::Nginx::HTTP2->new(); | 211 $s = Test::Nginx::HTTP2->new(); |
215 $sid = $s->new_stream(); | 212 $sid = $s->new_stream(); |
216 $s->read(all => [{ sid => $sid, fin => 1 }]); | 213 $s->read(all => [{ sid => $sid, fin => 1 }]); |
217 | 214 |
218 $s->h2_priority(0, $sid, $sid); | 215 $s->h2_priority(0, $sid, $sid); |
220 | 217 |
221 my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 218 my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
222 is($frame->{last_sid}, $sid, 'dependency - PRIORITY self - GOAWAY'); | 219 is($frame->{last_sid}, $sid, 'dependency - PRIORITY self - GOAWAY'); |
223 is($frame->{code}, 1, 'dependency - PRIORITY self - PROTOCOL_ERROR'); | 220 is($frame->{code}, 1, 'dependency - PRIORITY self - PROTOCOL_ERROR'); |
224 | 221 |
225 } | |
226 | |
227 # HEADERS PRIORITY flag, reprioritize prior PRIORITY frame records | 222 # HEADERS PRIORITY flag, reprioritize prior PRIORITY frame records |
228 | 223 |
229 $s = Test::Nginx::HTTP2->new(); | 224 $s = Test::Nginx::HTTP2->new(); |
230 | 225 |
231 $s->h2_priority(16, 1, 0); | 226 $s->h2_priority(16, 1, 0); |
276 $sids = join ' ', map { $_->{sid} } @data; | 271 $sids = join ' ', map { $_->{sid} } @data; |
277 is($sids, "$sid $sid2", 'dependency - HEADERS PRIORITY 2'); | 272 is($sids, "$sid $sid2", 'dependency - HEADERS PRIORITY 2'); |
278 | 273 |
279 # HEADERS - self dependency | 274 # HEADERS - self dependency |
280 | 275 |
281 TODO: { | |
282 local $TODO = 'not yet' unless $t->has_version('1.17.4'); | |
283 | |
284 $s = Test::Nginx::HTTP2->new(); | 276 $s = Test::Nginx::HTTP2->new(); |
285 $sid = $s->new_stream({ dep => 1 }); | 277 $sid = $s->new_stream({ dep => 1 }); |
286 $frames = $s->read(all => [{ type => 'GOAWAY' }]); | 278 $frames = $s->read(all => [{ type => 'GOAWAY' }]); |
287 | 279 |
288 my ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 280 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
289 is($frame->{last_sid}, 0, 'dependency - HEADERS self - GOAWAY'); | 281 is($frame->{last_sid}, 0, 'dependency - HEADERS self - GOAWAY'); |
290 is($frame->{code}, 1, 'dependency - HEADERS self - PROTOCOL_ERROR'); | 282 is($frame->{code}, 1, 'dependency - HEADERS self - PROTOCOL_ERROR'); |
291 | |
292 } | |
293 | 283 |
294 # PRIORITY frame, weighted dependencies | 284 # PRIORITY frame, weighted dependencies |
295 | 285 |
296 $s = Test::Nginx::HTTP2->new(); | 286 $s = Test::Nginx::HTTP2->new(); |
297 | 287 |
400 $frames = $s->read(all => [ | 390 $frames = $s->read(all => [ |
401 { sid => $sid, fin => 1 }, | 391 { sid => $sid, fin => 1 }, |
402 { sid => $sid3, fin => 1 }, | 392 { sid => $sid3, fin => 1 }, |
403 ]); | 393 ]); |
404 | 394 |
405 my ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; | 395 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid } @$frames; |
406 is($frame->{length}, 81, 'removed dependency - first stream'); | 396 is($frame->{length}, 81, 'removed dependency - first stream'); |
407 | 397 |
408 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid3 } @$frames; | 398 ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == $sid3 } @$frames; |
409 is($frame->{length}, 81, 'removed dependency - last stream'); | 399 is($frame->{length}, 81, 'removed dependency - last stream'); |
410 | 400 |