Mercurial > hg > nginx-tests
annotate proxy_cache_vary.t @ 1982:fb25cbe9d4ec
Tests: explicit Valgrind support.
Valgrind logging is done to a separate file, as it is not able to
follow stderr redirection within nginx or append to a file without
corrupting it. Further, Valgrind logging seems to interfere with
error suppression in tests, and catches various startup errors and
warnings, so the log is additionally filtered.
Since startup under Valgrind can be really slow, timeout in waitforfile()
was changed to 10 seconds.
Prodded by Robert Mueller.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 31 May 2024 06:23:00 +0300 |
parents | ce4419d32383 |
children | a095b971fbcc |
rev | line source |
---|---|
471 | 1 #!/usr/bin/perl |
2 | |
3 # (C) Maxim Dounin | |
4 | |
5 # Tests for http proxy cache, the Vary header. | |
6 | |
7 ############################################################################### | |
8 | |
9 use warnings; | |
10 use strict; | |
11 | |
12 use Test::More; | |
13 | |
14 BEGIN { use FindBin; chdir($FindBin::Bin); } | |
15 | |
16 use lib 'lib'; | |
17 use Test::Nginx; | |
18 | |
19 ############################################################################### | |
20 | |
21 select STDERR; $| = 1; | |
22 select STDOUT; $| = 1; | |
23 | |
1020
196d33c2bb45
Tests: removed TODO and try_run() checks for legacy versions.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
974
diff
changeset
|
24 my $t = Test::Nginx->new()->has(qw/http proxy cache gzip rewrite/) |
1770
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
25 ->plan(52)->write_file_expand('nginx.conf', <<'EOF'); |
471 | 26 |
27 %%TEST_GLOBALS%% | |
28 | |
29 daemon off; | |
30 | |
31 events { | |
32 } | |
33 | |
34 http { | |
35 %%TEST_GLOBALS_HTTP%% | |
36 | |
37 proxy_cache_path %%TESTDIR%%/cache keys_zone=one:1m inactive=5s; | |
38 proxy_cache_key $uri; | |
39 | |
40 server { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
41 listen 127.0.0.1:8080; |
471 | 42 server_name localhost; |
43 | |
44 add_header X-Cache-Status $upstream_cache_status; | |
45 | |
46 location / { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
47 proxy_pass http://127.0.0.1:8081/; |
471 | 48 proxy_cache one; |
49 } | |
50 | |
51 location /replace/ { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
52 proxy_pass http://127.0.0.1:8081/; |
471 | 53 proxy_cache one; |
54 } | |
55 | |
56 location /revalidate/ { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
57 proxy_pass http://127.0.0.1:8081/; |
471 | 58 proxy_cache one; |
59 proxy_cache_revalidate on; | |
60 } | |
61 | |
62 location /ignore/ { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
63 proxy_pass http://127.0.0.1:8081/; |
471 | 64 proxy_cache one; |
65 proxy_ignore_headers Vary; | |
66 } | |
67 } | |
68 | |
69 server { | |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
70 listen 127.0.0.1:8081; |
471 | 71 server_name localhost; |
72 | |
73 gzip on; | |
74 gzip_min_length 0; | |
75 gzip_http_version 1.0; | |
76 gzip_vary on; | |
77 | |
78 expires 2s; | |
79 | |
80 location / { | |
81 if ($args = "novary") { | |
82 return 200 "the only variant\n"; | |
83 } | |
84 } | |
85 | |
86 location /asterisk { | |
87 gzip off; | |
88 add_header Vary "*"; | |
89 } | |
90 | |
91 location /complex { | |
92 gzip off; | |
93 add_header Vary ",, Accept-encoding , ,"; | |
94 } | |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
95 |
1770
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
96 location /multi { |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
97 gzip off; |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
98 add_header Vary Accept-Encoding; |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
99 add_header Vary Foo; |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
100 } |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
101 |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
102 location /cold { |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
103 expires max; |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
104 add_header Vary $arg_vary; |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
105 add_header Xtra $arg_xtra; |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
106 } |
471 | 107 } |
108 } | |
109 | |
110 EOF | |
111 | |
112 $t->write_file('index.html', 'SEE-THIS'); | |
113 $t->write_file('asterisk', 'SEE-THIS'); | |
114 $t->write_file('complex', 'SEE-THIS'); | |
1770
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
115 $t->write_file('multi', 'SEE-THIS'); |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
116 $t->write_file('cold', 'SEE-THIS'); |
471 | 117 |
568
907e89fba9c3
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
507
diff
changeset
|
118 $t->run(); |
471 | 119 |
120 ############################################################################### | |
121 | |
122 like(get('/', 'gzip'), qr/MISS/ms, 'first request'); | |
123 like(get('/', 'gzip'), qr/HIT/ms, 'vary match cached'); | |
124 like(get('/', 'deflate'), qr/MISS/ms, 'vary mismatch'); | |
125 like(get('/', 'deflate'), qr/HIT/ms, 'vary mismatch cached'); | |
126 like(get('/', 'foo'), qr/MISS/ms, 'vary mismatch 2'); | |
127 like(get('/', 'foo'), qr/HIT/ms, 'vary mismatch 2 cached'); | |
128 like(get('/', 'gzip'), qr/HIT/ms, 'multiple representations cached'); | |
129 | |
130 SKIP: { | |
131 skip 'long tests', 6 unless $ENV{TEST_NGINX_UNSAFE}; | |
132 | |
133 # make sure all variants are properly expire | |
134 # and removed after inactive timeout | |
135 | |
136 sleep(3); | |
137 | |
138 like(get('/', 'gzip'), qr/EXPIRED/ms, 'first expired'); | |
139 like(get('/', 'deflate'), qr/EXPIRED/ms, 'second variant expired'); | |
140 | |
141 like(get('/', 'gzip'), qr/HIT/ms, 'first cached after expire'); | |
142 like(get('/', 'deflate'), qr/HIT/ms, 'second cached after expire'); | |
143 | |
144 sleep(12); | |
145 | |
146 like(get('/', 'gzip'), qr/MISS/ms, 'first inactive removed'); | |
147 like(get('/', 'deflate'), qr/MISS/ms, 'second variant removed'); | |
148 | |
149 } | |
150 | |
151 SKIP: { | |
152 skip 'long tests', 6 unless $ENV{TEST_NGINX_UNSAFE}; | |
153 | |
154 # check if the variant which was loaded first will be properly | |
155 # removed if it's not requested (but another variant is requested | |
156 # at the same time) | |
157 | |
158 sleep(3); | |
159 like(get('/', 'deflate'), qr/EXPIRED/ms, 'bump1'); | |
160 sleep(3); | |
161 like(get('/', 'deflate'), qr/EXPIRED/ms, 'bump2'); | |
162 sleep(3); | |
163 like(get('/', 'deflate'), qr/EXPIRED/ms, 'bump3'); | |
164 sleep(3); | |
165 like(get('/', 'deflate'), qr/EXPIRED/ms, 'bump4'); | |
166 | |
167 TODO: { | |
168 local $TODO = 'not yet'; | |
169 | |
476
4e335141aa4b
Tests: fix head() remnants in Vary tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
471
diff
changeset
|
170 like(get('/', 'gzip'), qr/MISS/ms, 'first not bumped by second requests'); |
471 | 171 |
172 } | |
173 | |
476
4e335141aa4b
Tests: fix head() remnants in Vary tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
471
diff
changeset
|
174 like(get('/', 'deflate'), qr/HIT/ms, 'second variant cached'); |
471 | 175 |
176 } | |
177 | |
178 # if a response without Vary is returned to replace previously returned | |
179 # responses with Vary, make sure it is then used in all cases | |
180 | |
181 like(get('/replace/', 'gzip'), qr/MISS/, 'replace first'); | |
182 like(get('/replace/', 'deflate'), qr/MISS/, 'replace second'); | |
183 | |
184 sleep(3); | |
185 | |
186 like(get('/replace/?novary', 'deflate'), qr/EXPIRED/, 'replace novary'); | |
187 like(get('/replace/?zztest', 'gzip'), qr/HIT/, 'all replaced'); | |
188 | |
189 # make sure revalidation of variants works fine | |
190 | |
191 like(get('/revalidate/', 'gzip'), qr/MISS/, 'revalidate first'); | |
192 like(get('/revalidate/', 'deflate'), qr/MISS/, 'revalidate second'); | |
193 | |
194 sleep(3); | |
195 | |
196 like(get('/revalidate/', 'gzip'), qr/REVALIDATED/, 'revalidated first'); | |
197 like(get('/revalidate/', 'deflate'), qr/REVALIDATED/, 'revalidated second'); | |
198 like(get('/revalidate/', 'gzip'), qr/HIT/, 'revalidate first after'); | |
199 like(get('/revalidate/', 'deflate'), qr/HIT/, 'revalidate second after'); | |
200 | |
201 # if the Vary header is ignored, cached version can be returned | |
202 # regardless of request headers | |
203 | |
204 like(get('/ignore/', 'gzip'), qr/MISS/ms, 'another request'); | |
205 like(get('/ignore/', 'deflate'), qr/HIT/ms, 'vary ignored'); | |
206 | |
207 # check parsing of Vary with multiple headers listed | |
208 | |
209 like(get('/complex', 'gzip'), qr/MISS/ms, 'vary complex first'); | |
210 like(get('/complex', 'deflate'), qr/MISS/ms, 'vary complex second'); | |
211 like(get('/complex', 'gzip'), qr/HIT/ms, 'vary complex first cached'); | |
212 like(get('/complex', 'deflate'), qr/HIT/ms, 'vary complex second cached'); | |
213 | |
214 # From RFC 7231, "7.1.4. Vary", | |
215 # http://tools.ietf.org/html/rfc7231#section-7.1.4: | |
216 # | |
217 # A Vary field value of "*" signals that anything about the request | |
218 # might play a role in selecting the response representation, possibly | |
219 # including elements outside the message syntax (e.g., the client's | |
220 # network address). A recipient will not be able to determine whether | |
221 # this response is appropriate for a later request without forwarding | |
222 # the request to the origin server. | |
223 # | |
224 # In theory, If-None-Match can be used to check if the representation | |
225 # present in the cache is appropriate. This seems to be only possible | |
226 # with strong entity tags though, as representation with different | |
227 # content condings may share the same weak entity tag. | |
228 | |
229 like(get('/asterisk', 'gzip'), qr/MISS/ms, 'vary asterisk first'); | |
230 like(get('/asterisk', 'gzip'), qr/MISS/ms, 'vary asterisk second'); | |
231 | |
232 # From RFC 7234, "4.1. Calculating Secondary Keys with Vary", | |
233 # http://tools.ietf.org/html/rfc7234#section-4.1: | |
234 # | |
235 # The selecting header fields from two requests are defined to match if | |
236 # and only if those in the first request can be transformed to those in | |
237 # the second request by applying any of the following: | |
238 # | |
239 # o adding or removing whitespace, where allowed in the header field's | |
240 # syntax | |
507 | 241 # |
471 | 242 # o combining multiple header fields with the same field name (see |
243 # Section 3.2 of [RFC7230]) | |
507 | 244 # |
471 | 245 # o normalizing both header field values in a way that is known to |
246 # have identical semantics, according to the header field's | |
247 # specification (e.g., reordering field values when order is not | |
248 # significant; case-normalization, where values are defined to be | |
249 # case-insensitive) | |
489
3036e3af0e08
Tests: more Vary normalization tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
481
diff
changeset
|
250 # |
3036e3af0e08
Tests: more Vary normalization tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
481
diff
changeset
|
251 # Only whitespace normalization is currently implemented. |
471 | 252 |
253 like(get('/', 'foo, bar'), qr/MISS/ms, 'normalize first'); | |
481
7e823c8f7d31
Tests: adjusted TODOs for cache Vary support committed in 1.7.7.
Sergey Kandaurov <pluknet@nginx.com>
parents:
478
diff
changeset
|
254 like(get('/', 'foo,bar'), qr/HIT/ms, 'normalize whitespace'); |
7e823c8f7d31
Tests: adjusted TODOs for cache Vary support committed in 1.7.7.
Sergey Kandaurov <pluknet@nginx.com>
parents:
478
diff
changeset
|
255 like(get('/', 'foo,, ,bar , '), qr/HIT/ms, 'normalize empty'); |
489
3036e3af0e08
Tests: more Vary normalization tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
481
diff
changeset
|
256 like(get('/', 'foobar'), qr/MISS/ms, 'normalize no whitespace mismatch'); |
471 | 257 |
258 TODO: { | |
259 local $TODO = 'not yet'; | |
260 | |
261 like(get('/', 'bar,foo'), qr/HIT/ms, 'normalize order'); | |
262 | |
263 } | |
264 | |
1770
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
265 # Multiple Vary headers (ticket #1423). |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
266 |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
267 like(get('/multi', 'foo'), qr/MISS/ms, 'multi first'); |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
268 like(get('/multi', 'foo'), qr/HIT/ms, 'multi second'); |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
269 |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
270 TODO: { |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
271 local $TODO = 'not yet' unless $t->has_version('1.23.0'); |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
272 |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
273 like(get('/multi', 'bar'), qr/MISS/ms, 'multi other'); |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
274 |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
275 } |
ce4419d32383
Tests: tests for multiple Vary headers (ticket #1423).
Maxim Dounin <mdounin@mdounin.ru>
parents:
1693
diff
changeset
|
276 |
1590
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
277 # keep c->body_start when Vary changes (ticket #2029) |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
278 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
279 # before 1.19.3, this prevented updating c->body_start of a main key |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
280 # triggering "cache file .. has too long header" critical errors |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
281 |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
282 get1('/cold?vary=z', 'z:1'); |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
283 like(get1('/cold?vary=x,y', 'x:1'), qr/MISS/, 'change first'); |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
284 like(get1('/cold?vary=x,y', 'x:1'), qr/HIT/, 'change first cached'); |
1590
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
285 |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
286 like(get1('/cold?vary=x,y&xtra=1', 'x:2'), qr/MISS/, 'change second'); |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
287 like(get1('/cold?vary=x,y&xtra=1', 'x:2'), qr/HIT/, 'change second cached'); |
1590
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
288 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
289 $t->stop(); |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
290 $t->run(); |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
291 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
292 # reset c->body_start when loading a secondary key variant |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
293 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
294 # before 1.19.3, it was loaded using a variant stored with a main key |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
295 # triggering "cache file .. has too long header" critical errors |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
296 |
1672
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
297 like(get1('/cold?vary=x,y', 'x:1'), qr/HIT/, 'cold first'); |
feb754918372
Tests: adjusted caching time for Vary tests with cold cache.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1590
diff
changeset
|
298 like(get1('/cold?vary=x,y&xtra=1', 'x:2'), qr/HIT/, 'cold second'); |
1590
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
299 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
300 $t->stop(); |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
301 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
302 like(`grep -F '[crit]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no crit'); |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
303 |
471 | 304 ############################################################################### |
305 | |
306 sub get { | |
307 my ($url, $extra) = @_; | |
308 return http(<<EOF); | |
309 GET $url HTTP/1.1 | |
310 Host: localhost | |
311 Connection: close | |
312 Accept-Encoding: $extra | |
313 | |
314 EOF | |
315 } | |
316 | |
1590
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
317 sub get1 { |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
318 my ($url, $extra) = @_; |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
319 return http(<<EOF); |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
320 GET $url HTTP/1.1 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
321 Host: localhost |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
322 Connection: close |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
323 $extra |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
324 |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
325 EOF |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
326 } |
e682d5ad3861
Tests: added two cache Vary cases fixed in 1.19.3.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
327 |
471 | 328 ############################################################################### |