Mercurial > hg > nginx-tests
comparison scgi_cache.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 | d4a0232425ee |
children | 196d33c2bb45 |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
42 scgi_cache_key $request_uri; | 42 scgi_cache_key $request_uri; |
43 | 43 |
44 add_header X-Cache-Status $upstream_cache_status; | 44 add_header X-Cache-Status $upstream_cache_status; |
45 | 45 |
46 server { | 46 server { |
47 listen 127.0.0.1:%%PORT_0%%; | 47 listen 127.0.0.1:8080; |
48 server_name localhost; | 48 server_name localhost; |
49 | 49 |
50 location / { | 50 location / { |
51 scgi_pass 127.0.0.1:%%PORT_1%%; | 51 scgi_pass 127.0.0.1:8081; |
52 scgi_param SCGI 1; | 52 scgi_param SCGI 1; |
53 scgi_param REQUEST_URI $uri; | 53 scgi_param REQUEST_URI $uri; |
54 scgi_cache one; | 54 scgi_cache one; |
55 } | 55 } |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 EOF | 59 EOF |
60 | 60 |
61 $t->run_daemon(\&scgi_daemon); | 61 $t->run_daemon(\&scgi_daemon); |
62 $t->run()->waitforsocket('127.0.0.1:' . port(1)); | 62 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); |
63 | 63 |
64 ############################################################################### | 64 ############################################################################### |
65 | 65 |
66 like(http_get('/len'), qr/MISS/, 'length'); | 66 like(http_get('/len'), qr/MISS/, 'length'); |
67 like(http_get('/len'), qr/HIT/, 'length cached'); | 67 like(http_get('/len'), qr/HIT/, 'length cached'); |
81 ############################################################################### | 81 ############################################################################### |
82 | 82 |
83 sub scgi_daemon { | 83 sub scgi_daemon { |
84 my $server = IO::Socket::INET->new( | 84 my $server = IO::Socket::INET->new( |
85 Proto => 'tcp', | 85 Proto => 'tcp', |
86 LocalHost => '127.0.0.1:' . port(1), | 86 LocalHost => '127.0.0.1:' . port(8081), |
87 Listen => 5, | 87 Listen => 5, |
88 Reuse => 1 | 88 Reuse => 1 |
89 ) | 89 ) |
90 or die "Can't create listening socket: $!\n"; | 90 or die "Can't create listening socket: $!\n"; |
91 | 91 |