# HG changeset patch # User Sergey Kandaurov # Date 1441204668 -10800 # Node ID 66f94d6c5047c8e563acb3c449ac3cdf4feb98ad # Parent 0c70eb166a3a76ca28e0c439416f3f4507375c20 Tests: more HTTP/2 error handling tests. Make sure that, besides GOAWAY, connection is closed on a connection error. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) ->has(qw/limit_conn rewrite realip shmem/) - ->has_daemon('openssl')->plan(159); + ->has_daemon('openssl')->plan(161); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -496,7 +496,7 @@ isnt($frame, undef, 'updated table size $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; -is($frame, undef, 'updated table size - invalid index'); +is($frame, undef, 'invalid index'); # 5.4.1. Connection Error Handling # An endpoint that encounters a connection error SHOULD first send a @@ -506,10 +506,14 @@ TODO: { local $TODO = 'not yet'; ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; -ok($frame, 'updated table size - invalid index GOAWAY'); +ok($frame, 'invalid index - GOAWAY'); } +h2_ping($sess, 'SEE-THIS'); +is(@{h2_read($sess, all => [{ type => 'PING' }])}, 0, 'invalid index - PING'); +is($sess->{socket}->connected, undef, 'invalid index - connection close'); + # HEAD $sess = new_session();