Mercurial > hg > nginx-tests
comparison h2.t @ 661:c99c30afc1c9
Tests: one more test for http2_max_concurrent_streams.
Ensure that the directive limits only active streams.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 24 Aug 2015 19:45:41 +0300 |
parents | b0342dbd9390 |
children | 07de3d202eb7 |
comparison
equal
deleted
inserted
replaced
660:b0342dbd9390 | 661:c99c30afc1c9 |
---|---|
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(152); | 35 ->has_daemon('openssl')->plan(153); |
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 |
1336 $sid2 = new_stream($sess, { path => '/t1.html' }); | 1336 $sid2 = new_stream($sess, { path => '/t1.html' }); |
1337 $frames = h2_read($sess); | 1337 $frames = h2_read($sess); |
1338 | 1338 |
1339 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; | 1339 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid2 } @$frames; |
1340 isnt($frame->{headers}->{':status'}, 200, 'http2_max_concurrent_streams 2'); | 1340 isnt($frame->{headers}->{':status'}, 200, 'http2_max_concurrent_streams 2'); |
1341 | |
1342 h2_window($sess, 2**16, $sid); | |
1343 h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | |
1344 | |
1345 $sid = new_stream($sess, { path => '/t2.html' }); | |
1346 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | |
1347 | |
1348 ($frame) = grep { $_->{type} eq "HEADERS" && $_->{sid} == $sid } @$frames; | |
1349 is($frame->{headers}->{':status'}, 200, 'http2_max_concurrent_streams 3'); | |
1341 | 1350 |
1342 | 1351 |
1343 # some invalid cases below | 1352 # some invalid cases below |
1344 | 1353 |
1345 # GOAWAY on SYN_STREAM with even StreamID | 1354 # GOAWAY on SYN_STREAM with even StreamID |