Mercurial > hg > nginx-tests
comparison h2_proxy_cache.t @ 1252:93453d7858ce
Tests: removed rewrite dependency in h2_proxy_cache.t.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 28 Nov 2017 14:48:59 +0300 |
parents | efccab043dd3 |
children | 86e6287707ee |
comparison
equal
deleted
inserted
replaced
1251:766bcbb632ee | 1252:93453d7858ce |
---|---|
21 ############################################################################### | 21 ############################################################################### |
22 | 22 |
23 select STDERR; $| = 1; | 23 select STDERR; $| = 1; |
24 select STDOUT; $| = 1; | 24 select STDOUT; $| = 1; |
25 | 25 |
26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache rewrite/)->plan(12) | 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache/)->plan(12) |
27 ->write_file_expand('nginx.conf', <<'EOF'); | 27 ->write_file_expand('nginx.conf', <<'EOF'); |
28 | 28 |
29 %%TEST_GLOBALS%% | 29 %%TEST_GLOBALS%% |
30 | 30 |
31 daemon off; | 31 daemon off; |
50 location /cache { | 50 location /cache { |
51 proxy_pass http://127.0.0.1:8081/; | 51 proxy_pass http://127.0.0.1:8081/; |
52 proxy_cache NAME; | 52 proxy_cache NAME; |
53 proxy_cache_valid 1m; | 53 proxy_cache_valid 1m; |
54 } | 54 } |
55 | |
55 location /proxy_buffering_off { | 56 location /proxy_buffering_off { |
56 proxy_pass http://127.0.0.1:8081/; | 57 proxy_pass http://127.0.0.1:8081/; |
57 proxy_cache NAME; | 58 proxy_cache NAME; |
58 proxy_cache_valid 1m; | 59 proxy_cache_valid 1m; |
59 proxy_buffering off; | 60 proxy_buffering off; |
60 } | 61 } |
61 location / { | 62 |
62 if ($arg_slow) { | 63 location / { } |
63 set $limit_rate 200; | 64 |
64 } | 65 location /slow { |
66 limit_rate 200; | |
65 } | 67 } |
66 } | 68 } |
67 } | 69 } |
68 | 70 |
69 EOF | 71 EOF |
70 | 72 |
71 $t->write_file('t.html', 'SEE-THIS'); | 73 $t->write_file('t.html', 'SEE-THIS'); |
74 $t->write_file('slow.html', 'SEE-THIS'); | |
72 $t->run(); | 75 $t->run(); |
73 | 76 |
74 ############################################################################### | 77 ############################################################################### |
75 | 78 |
76 # simple proxy cache test | 79 # simple proxy cache test |
156 | 159 |
157 # client cancels stream with a cacheable request that was sent to upstream | 160 # client cancels stream with a cacheable request that was sent to upstream |
158 # HEADERS should not be produced for the canceled stream | 161 # HEADERS should not be produced for the canceled stream |
159 | 162 |
160 $s = Test::Nginx::HTTP2->new(); | 163 $s = Test::Nginx::HTTP2->new(); |
161 $sid = $s->new_stream({ path => '/cache/t.html?slow=1' }); | 164 $sid = $s->new_stream({ path => '/cache/slow.html' }); |
162 | 165 |
163 $s->h2_rst($sid, 8); | 166 $s->h2_rst($sid, 8); |
164 | 167 |
165 $frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 1.2); | 168 $frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 1.2); |
166 ok(!(grep { $_->{type} eq "HEADERS" } @$frames), 'no headers'); | 169 ok(!(grep { $_->{type} eq "HEADERS" } @$frames), 'no headers'); |