comparison h2.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 29f0e926c15f
children f3de5730bc06
comparison
equal deleted inserted replaced
1692:f6795e2e6a4b 1693:5ac6efbe5552
227 227
228 # 6.8. GOAWAY 228 # 6.8. GOAWAY
229 # An endpoint MUST treat a GOAWAY frame with a stream identifier other 229 # An endpoint MUST treat a GOAWAY frame with a stream identifier other
230 # than 0x0 as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. 230 # than 0x0 as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.
231 231
232 TODO: {
233 local $TODO = 'not yet' unless $t->has_version('1.19.3');
234
235 $s = Test::Nginx::HTTP2->new(); 232 $s = Test::Nginx::HTTP2->new();
236 $s->h2_goaway(1, 0, 5, 'foobar'); 233 $s->h2_goaway(1, 0, 5, 'foobar');
237 $frames = $s->read(all => [{ type => "GOAWAY" }], wait => 0.5); 234 $frames = $s->read(all => [{ type => "GOAWAY" }], wait => 0.5);
238 235
239 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; 236 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
240 ok($frame, 'GOAWAY invalid stream - GOAWAY frame'); 237 ok($frame, 'GOAWAY invalid stream - GOAWAY frame');
241 is($frame->{code}, 1, 'GOAWAY invalid stream - GOAWAY PROTOCOL_ERROR'); 238 is($frame->{code}, 1, 'GOAWAY invalid stream - GOAWAY PROTOCOL_ERROR');
242
243 }
244 239
245 # client-initiated PUSH_PROMISE, just to ensure nothing went wrong 240 # client-initiated PUSH_PROMISE, just to ensure nothing went wrong
246 # N.B. other implementation returns zero code, which is not anyhow regulated 241 # N.B. other implementation returns zero code, which is not anyhow regulated
247 242
248 $s = Test::Nginx::HTTP2->new(); 243 $s = Test::Nginx::HTTP2->new();
590 585
591 $s = Test::Nginx::HTTP2->new(port(8087)); 586 $s = Test::Nginx::HTTP2->new(port(8087));
592 $sid = $s->new_stream({ path => '/t2.html', split => [20], split_delay => 2.1 }); 587 $sid = $s->new_stream({ path => '/t2.html', split => [20], split_delay => 2.1 });
593 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); 588 $frames = $s->read(all => [{ type => 'RST_STREAM' }]);
594 589
595 TODO: {
596 local $TODO = 'not yet' unless $t->has_version('1.17.9');
597
598 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; 590 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
599 ok($frame, 'client header timeout 2'); 591 ok($frame, 'client header timeout 2');
600 is($frame->{code}, 1, 'client header timeout 2 - protocol error'); 592 is($frame->{code}, 1, 'client header timeout 2 - protocol error');
601
602 }
603 593
604 $s->h2_ping('SEE-THIS'); 594 $s->h2_ping('SEE-THIS');
605 $frames = $s->read(all => [{ type => 'PING' }]); 595 $frames = $s->read(all => [{ type => 'PING' }]);
606 596
607 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; 597 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames;