comparison proxy_cache_chunked.t @ 974:882267679006

Tests: simplified parallel modifications in tests. Mail tests were simplified in c227348453db.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 12 Jul 2016 17:39:03 +0300
parents e9064d691790
children 196d33c2bb45
comparison
equal deleted inserted replaced
973:7d7aef8b9f3a 974:882267679006
38 %%TEST_GLOBALS_HTTP%% 38 %%TEST_GLOBALS_HTTP%%
39 39
40 proxy_cache_path %%TESTDIR%%/cache keys_zone=NAME:1m; 40 proxy_cache_path %%TESTDIR%%/cache keys_zone=NAME:1m;
41 41
42 server { 42 server {
43 listen 127.0.0.1:%%PORT_0%%; 43 listen 127.0.0.1:8080;
44 server_name localhost; 44 server_name localhost;
45 45
46 location / { 46 location / {
47 proxy_pass http://127.0.0.1:%%PORT_1%%; 47 proxy_pass http://127.0.0.1:8081;
48 proxy_http_version 1.1; 48 proxy_http_version 1.1;
49 proxy_cache NAME; 49 proxy_cache NAME;
50 proxy_cache_valid any 1m; 50 proxy_cache_valid any 1m;
51 add_header X-Status $upstream_cache_status; 51 add_header X-Status $upstream_cache_status;
52 } 52 }
54 } 54 }
55 55
56 EOF 56 EOF
57 57
58 $t->run_daemon(\&http_chunked_daemon); 58 $t->run_daemon(\&http_chunked_daemon);
59 $t->run()->waitforsocket('127.0.0.1:' . port(1)); 59 $t->run()->waitforsocket('127.0.0.1:' . port(8081));
60 60
61 ############################################################################### 61 ###############################################################################
62 62
63 like(http_get("/"), qr/SEE-THIS/s, "chunked"); 63 like(http_get("/"), qr/SEE-THIS/s, "chunked");
64 like(http_get("/"), qr/SEE-THIS.*HIT/s, "chunked cached"); 64 like(http_get("/"), qr/SEE-THIS.*HIT/s, "chunked cached");
66 ############################################################################### 66 ###############################################################################
67 67
68 sub http_chunked_daemon { 68 sub http_chunked_daemon {
69 my $server = IO::Socket::INET->new( 69 my $server = IO::Socket::INET->new(
70 Proto => 'tcp', 70 Proto => 'tcp',
71 LocalAddr => '127.0.0.1:' . port(1), 71 LocalAddr => '127.0.0.1:' . port(8081),
72 Listen => 5, 72 Listen => 5,
73 Reuse => 1 73 Reuse => 1
74 ) 74 )
75 or die "Can't create listening socket: $!\n"; 75 or die "Can't create listening socket: $!\n";
76 76