Mercurial > hg > nginx-tests
comparison h2.t @ 738:0881219c0699
Tests: HTTP/2 tests for Upgrade-based negotiation.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 19 Oct 2015 17:03:04 +0300 |
parents | abf42eb6cf48 |
children | 610e394a6e73 |
comparison
equal
deleted
inserted
replaced
737:abf42eb6cf48 | 738:0881219c0699 |
---|---|
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(223); | 35 ->has_daemon('openssl')->plan(225); |
36 | 36 |
37 # Some systems have a bug in not treating zero writev iovcnt as EINVAL | 37 # Some systems have a bug in not treating zero writev iovcnt as EINVAL |
38 | 38 |
39 $t->todo_alerts() if $^O eq 'darwin'; | 39 $t->todo_alerts() if $^O eq 'darwin'; |
40 | 40 |
258 8 => { name => 'WINDOW_UPDATE', value => \&window_update }, | 258 8 => { name => 'WINDOW_UPDATE', value => \&window_update }, |
259 9 => { name => 'CONTINUATION', value => \&headers }, | 259 9 => { name => 'CONTINUATION', value => \&headers }, |
260 ); | 260 ); |
261 | 261 |
262 ############################################################################### | 262 ############################################################################### |
263 | |
264 # Upgrade mechanism | |
265 | |
266 my $r = http(<<EOF); | |
267 GET / HTTP/1.1 | |
268 Host: localhost | |
269 Connection: Upgrade, HTTP2-Settings | |
270 Upgrade: h2c | |
271 HTTP2-Settings: AAMAAABkAAQAAP__ | |
272 | |
273 EOF | |
274 | |
275 SKIP: { | |
276 skip 'no Upgrade-based negotiation', 2 if $r !~ m!HTTP/1.1 101!; | |
277 | |
278 like($r, qr!Connection: Upgrade!, 'upgrade - connection'); | |
279 like($r, qr!Upgrade: h2c!, 'upgrade - token'); | |
280 | |
281 } | |
263 | 282 |
264 # SETTINGS | 283 # SETTINGS |
265 | 284 |
266 my $sess = new_session(); | 285 my $sess = new_session(); |
267 my $frames = h2_read($sess, all => [ | 286 my $frames = h2_read($sess, all => [ |