Mercurial > hg > nginx-tests
comparison h2.t @ 789:eb257a102a9b
Tests: turn typo into an actual RST_STREAM test with invalid path.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 19 Nov 2015 17:25:19 +0300 |
parents | 91e23e0c923a |
children | fed83003c45c |
comparison
equal
deleted
inserted
replaced
788:1f48ed26b49a | 789:eb257a102a9b |
---|---|
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(290); | 35 ->has_daemon('openssl')->plan(291); |
36 | 36 |
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL | 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL |
38 | 38 |
39 $t->todo_alerts(); | 39 $t->todo_alerts(); |
40 | 40 |
2857 $frames = h2_read($sess, all => [{ type => 'PING' }]); | 2857 $frames = h2_read($sess, all => [{ type => 'PING' }]); |
2858 | 2858 |
2859 ($frame) = grep { $_->{type} eq "PING" } @$frames; | 2859 ($frame) = grep { $_->{type} eq "PING" } @$frames; |
2860 is($frame->{value}, 'SEE-THIS', 'unknown frame type'); | 2860 is($frame->{value}, 'SEE-THIS', 'unknown frame type'); |
2861 | 2861 |
2862 # client sent invalid :path header | |
2863 | |
2864 $sid = new_stream($sess, { path => 't1.html' }); | |
2865 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); | |
2866 | |
2867 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; | |
2868 is($frame->{code}, 1, 'invalid path'); | |
2869 | |
2862 # GOAWAY - force closing a connection by server | 2870 # GOAWAY - force closing a connection by server |
2863 | 2871 |
2864 $sid = new_stream($sess, { path => 't1.html' }); | 2872 $sid = new_stream($sess); |
2865 h2_read($sess, all => [{ sid => $sid, length => 2**16 - 1 }]); | 2873 h2_read($sess, all => [{ sid => $sid, fin => 1 }]); |
2866 | 2874 |
2867 # graceful shutdown with stream waiting on HEADERS payload | 2875 # graceful shutdown with stream waiting on HEADERS payload |
2868 | 2876 |
2869 my $grace = new_session(8089); | 2877 my $grace = new_session(8089); |
2870 new_stream($grace, { split => [ 9 ], abort => 1 }); | 2878 new_stream($grace, { split => [ 9 ], abort => 1 }); |