Mercurial > hg > nginx-tests
comparison proxy_cache_chunked.t @ 952:e9064d691790
Tests: converted tests to run in parallel.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jun 2016 16:39:13 +0300 |
parents | f02dac68d584 |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
951:9361c7eddfc1 | 952:e9064d691790 |
---|---|
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:8080; | 43 listen 127.0.0.1:%%PORT_0%%; |
44 server_name localhost; | 44 server_name localhost; |
45 | 45 |
46 location / { | 46 location / { |
47 proxy_pass http://127.0.0.1:8081; | 47 proxy_pass http://127.0.0.1:%%PORT_1%%; |
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:8081'); | 59 $t->run()->waitforsocket('127.0.0.1:' . port(1)); |
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:8081', | 71 LocalAddr => '127.0.0.1:' . port(1), |
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 |