comparison proxy-store.t @ 90:1d3c82227a05

Tests: subrequests with proxy_store todo test.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 05 May 2009 00:56:35 +0400
parents abbe4b123795
children 1c0ec30614c6
comparison
equal deleted inserted replaced
89:abbe4b123795 90:1d3c82227a05
7 ############################################################################### 7 ###############################################################################
8 8
9 use warnings; 9 use warnings;
10 use strict; 10 use strict;
11 11
12 use Test::More tests => 6; 12 use Test::More tests => 7;
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;
45 45
46 location /store- { 46 location /store- {
47 proxy_pass http://127.0.0.1:8080/; 47 proxy_pass http://127.0.0.1:8080/;
48 proxy_store on; 48 proxy_store on;
49 } 49 }
50 location /ssi.html {
51 ssi on;
52 }
50 location /index-nostore.html { 53 location /index-nostore.html {
51 add_header X-Accel-Expires 0; 54 add_header X-Accel-Expires 0;
52 } 55 }
53 location /index-big.html { 56 location /index-big.html {
54 limit_rate 200k; 57 limit_rate 200k;
59 EOF 62 EOF
60 63
61 $t->write_file('index.html', 'SEE-THIS'); 64 $t->write_file('index.html', 'SEE-THIS');
62 $t->write_file('index-nostore.html', 'SEE-THIS'); 65 $t->write_file('index-nostore.html', 'SEE-THIS');
63 $t->write_file('index-big.html', 'x' x (100 << 10)); 66 $t->write_file('index-big.html', 'x' x (100 << 10));
67 $t->write_file('ssi.html',
68 '<!--#include virtual="/store-index-big.html?1" -->' .
69 '<!--#include virtual="/store-index-big.html?2" -->'
70 );
64 $t->run(); 71 $t->run();
65 72
66 ############################################################################### 73 ###############################################################################
67 74
68 like(http_get('/store-index.html'), qr/SEE-THIS/, 'proxy request'); 75 like(http_get('/store-index.html'), qr/SEE-THIS/, 'proxy request');
83 sleep(1); 90 sleep(1);
84 91
85 ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 92 ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0,
86 'no temp files after aborted request'); 93 'no temp files after aborted request');
87 94
95 TODO: {
96 local $TODO = 'not fixed yet';
97
98 http_get('/ssi.html', aborted => 1, sleep => 0.1);
99 sleep(1);
100
101 ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0,
102 'no temp files after aborted ssi');
103
104 }
105
88 ############################################################################### 106 ###############################################################################