Mercurial > hg > nginx-tests
comparison proxy_cache_use_stale.t @ 1381:97c8280de681
Tests: removed TODO and try_run() checks for legacy versions.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 08 Oct 2018 15:30:39 +0300 |
parents | fc43a3555095 |
children | aaaa8a40250b |
comparison
equal
deleted
inserted
replaced
1380:f50c7d90f5c9 | 1381:97c8280de681 |
---|---|
218 | 218 |
219 # stale response not blocked by background update. | 219 # stale response not blocked by background update. |
220 # before 1.13.1, if stale response was not sent in one pass, its remaining | 220 # before 1.13.1, if stale response was not sent in one pass, its remaining |
221 # part was blocked and not sent until background update has been finished | 221 # part was blocked and not sent until background update has been finished |
222 | 222 |
223 TODO: { | |
224 local $TODO = 'not yet' unless $t->has_version('1.13.1'); | |
225 | |
226 $t->write_file('t7.html', 'SEE-THAT' x 1024); | 223 $t->write_file('t7.html', 'SEE-THAT' x 1024); |
227 | 224 |
228 my $r = read_all(get('/t7.html?lim=1', 'max-age=1', start => 1)); | 225 my $r = read_all(get('/t7.html?lim=1', 'max-age=1', start => 1)); |
229 like($r, qr/STALE.*^(SEE-THIS){1024}$/ms, 's-w-r - stale response not blocked'); | 226 like($r, qr/STALE.*^(SEE-THIS){1024}$/ms, 's-w-r - stale response not blocked'); |
230 | 227 |
232 $t->write_file('ssi.html', 'xxx <!--#include virtual="/t9.html?lim=1" --> xxx'); | 229 $t->write_file('ssi.html', 'xxx <!--#include virtual="/t9.html?lim=1" --> xxx'); |
233 | 230 |
234 $r = read_all(http_get('/ssi.html', start => 1)); | 231 $r = read_all(http_get('/ssi.html', start => 1)); |
235 like($r, qr/^xxx (SEE-THIS){1024} xxx$/ms, 's-w-r - not blocked in subrequest'); | 232 like($r, qr/^xxx (SEE-THIS){1024} xxx$/ms, 's-w-r - not blocked in subrequest'); |
236 | 233 |
237 } | |
238 | |
239 # "aio_write" is used to produce "open socket ... left in connection" alerts. | 234 # "aio_write" is used to produce "open socket ... left in connection" alerts. |
240 | 235 |
241 $t->todo_alerts() if $t->read_file('nginx.conf') =~ /aio_write on/ | 236 $t->todo_alerts() if $t->read_file('nginx.conf') =~ /aio_write on/ |
242 and $t->read_file('nginx.conf') =~ /aio threads/ and $^O eq 'freebsd'; | 237 and $t->read_file('nginx.conf') =~ /aio threads/ and $^O eq 'freebsd'; |
243 | 238 |
252 $t->write_file('escape.html', 'SEE-THAT'); | 247 $t->write_file('escape.html', 'SEE-THAT'); |
253 $t->write_file('escape html', 'SEE-THAT'); | 248 $t->write_file('escape html', 'SEE-THAT'); |
254 | 249 |
255 get('/escape.htm%6C', 'max-age=1'); | 250 get('/escape.htm%6C', 'max-age=1'); |
256 get('/escape html', 'max-age=1'); | 251 get('/escape html', 'max-age=1'); |
257 | |
258 TODO: { | |
259 local $TODO = 'not yet' unless $t->has_version('1.13.8'); | |
260 | 252 |
261 like(http_get('/escape.htm%6C'), qr/HIT/, 'escaped after escaped'); | 253 like(http_get('/escape.htm%6C'), qr/HIT/, 'escaped after escaped'); |
262 like(http_get('/escape.html'), qr/MISS/, 'unescaped after escaped'); | 254 like(http_get('/escape.html'), qr/MISS/, 'unescaped after escaped'); |
263 like(http_get('/escape html'), qr/HIT/, 'space after escaped space'); | 255 like(http_get('/escape html'), qr/HIT/, 'space after escaped space'); |
264 | |
265 } | |
266 | |
267 like(http_get('/escape%20html'), qr/HIT/, 'escaped space after escaped space'); | 256 like(http_get('/escape%20html'), qr/HIT/, 'escaped space after escaped space'); |
268 | 257 |
269 ############################################################################### | 258 ############################################################################### |
270 | 259 |
271 sub get { | 260 sub get { |