Mercurial > hg > nginx-tests
comparison h2.t @ 691:3f4a132c6463
Tests: extended HTTP/2 tests for GOAWAY on compression error.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 14 Sep 2015 13:23:37 +0300 |
parents | fdc748de6fad |
children | a16d4a768197 |
comparison
equal
deleted
inserted
replaced
690:a894f041244e | 691:3f4a132c6463 |
---|---|
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; | 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; |
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; | 31 plan(skip_all => 'IO::Socket::SSL too old') if $@; |
32 | 32 |
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) | 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) |
34 ->has(qw/limit_conn rewrite realip shmem/) | 34 ->has(qw/limit_conn rewrite realip shmem/) |
35 ->has_daemon('openssl')->plan(177); | 35 ->has_daemon('openssl')->plan(179); |
36 | 36 |
37 $t->write_file_expand('nginx.conf', <<'EOF'); | 37 $t->write_file_expand('nginx.conf', <<'EOF'); |
38 | 38 |
39 %%TEST_GLOBALS%% | 39 %%TEST_GLOBALS%% |
40 | 40 |
524 TODO: { | 524 TODO: { |
525 local $TODO = 'not yet'; | 525 local $TODO = 'not yet'; |
526 | 526 |
527 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 527 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
528 ok($frame, 'invalid index - GOAWAY'); | 528 ok($frame, 'invalid index - GOAWAY'); |
529 | |
530 # RFC 7541, 2.3.3. Index Address Space | |
531 # Indices strictly greater than the sum of the lengths of both tables | |
532 # MUST be treated as a decoding error. | |
533 | |
534 # 4.3. Header Compression and Decompression | |
535 # A decoding error in a header block MUST be treated | |
536 # as a connection error of type COMPRESSION_ERROR. | |
537 | |
538 is($frame->{last_sid}, $sid, 'invalid index - GOAWAY last stream'); | |
539 is($frame->{code}, 9, 'invalid index - GOAWAY COMPRESSION_ERROR'); | |
529 | 540 |
530 } | 541 } |
531 | 542 |
532 h2_ping($sess, 'SEE-THIS'); | 543 h2_ping($sess, 'SEE-THIS'); |
533 is(@{h2_read($sess, all => [{ type => 'PING' }])}, 0, 'invalid index - PING'); | 544 is(@{h2_read($sess, all => [{ type => 'PING' }])}, 0, 'invalid index - PING'); |