comparison proxy-cache.t @ 80:14cf2658592d

Tests: add more proxy_cache tests, remove obsolete clean_time.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 06 Apr 2009 04:48:51 +0400
parents 3afbba94c8eb
children f92852da34aa
comparison
equal deleted inserted replaced
79:d5330d926fac 80:14cf2658592d
7 ############################################################################### 7 ###############################################################################
8 8
9 use warnings; 9 use warnings;
10 use strict; 10 use strict;
11 11
12 use Test::More tests => 2; 12 use Test::More tests => 5;
13 13
14 BEGIN { use FindBin; chdir($FindBin::Bin); } 14 BEGIN { use FindBin; chdir($FindBin::Bin); }
15 15
16 use lib 'lib'; 16 use lib 'lib';
17 use Test::Nginx; 17 use Test::Nginx;
38 client_body_temp_path %%TESTDIR%%/client_body_temp; 38 client_body_temp_path %%TESTDIR%%/client_body_temp;
39 fastcgi_temp_path %%TESTDIR%%/fastcgi_temp; 39 fastcgi_temp_path %%TESTDIR%%/fastcgi_temp;
40 proxy_temp_path %%TESTDIR%%/proxy_temp; 40 proxy_temp_path %%TESTDIR%%/proxy_temp;
41 41
42 proxy_cache_path %%TESTDIR%%/cache levels=1:2 42 proxy_cache_path %%TESTDIR%%/cache levels=1:2
43 keys_zone=NAME:10m 43 keys_zone=NAME:10m;
44 inactive=5m clean_time=2h00m;
45 44
46 server { 45 server {
47 listen 127.0.0.1:8080; 46 listen 127.0.0.1:8080;
48 server_name localhost; 47 server_name localhost;
49 48
71 } 70 }
72 71
73 EOF 72 EOF
74 73
75 $t->write_file('t.html', 'SEE-THIS'); 74 $t->write_file('t.html', 'SEE-THIS');
75 $t->write_file('t2.html', 'SEE-THIS');
76 $t->run(); 76 $t->run();
77 77
78 ############################################################################### 78 ###############################################################################
79 79
80 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request'); 80 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request');
81 81
82 $t->write_file('t.html', 'NOOP'); 82 $t->write_file('t.html', 'NOOP');
83 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request cached'); 83 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request cached');
84 84
85 unlike(http_head('/t2.html'), qr/SEE-THIS/, 'head request');
86 like(http_get('/t2.html'), qr/SEE-THIS/, 'get after head');
87 unlike(http_head('/t2.html'), qr/SEE-THIS/, 'head after get');
88
85 ############################################################################### 89 ###############################################################################