Mercurial > hg > nginx-tests
comparison proxy_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 | 38 |
39 http { | 39 http { |
40 %%TEST_GLOBALS_HTTP%% | 40 %%TEST_GLOBALS_HTTP%% |
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_read_timeout 1s; | 48 proxy_read_timeout 1s; |
49 } | 49 } |
50 location /nobuffering { | 50 location /nobuffering { |
51 proxy_pass http://127.0.0.1:8081; | 51 proxy_pass http://127.0.0.1:%%PORT_1%%; |
52 proxy_read_timeout 1s; | 52 proxy_read_timeout 1s; |
53 proxy_buffering off; | 53 proxy_buffering off; |
54 } | 54 } |
55 location /inmemory.html { | 55 location /inmemory.html { |
56 ssi on; | 56 ssi on; |
62 | 62 |
63 $t->write_file('inmemory.html', | 63 $t->write_file('inmemory.html', |
64 '<!--#include virtual="/" set="one" --><!--#echo var="one" -->'); | 64 '<!--#include virtual="/" set="one" --><!--#echo var="one" -->'); |
65 | 65 |
66 $t->run_daemon(\&http_chunked_daemon); | 66 $t->run_daemon(\&http_chunked_daemon); |
67 $t->run()->waitforsocket('127.0.0.1:8081'); | 67 $t->run()->waitforsocket('127.0.0.1:' . port(1)); |
68 | 68 |
69 ############################################################################### | 69 ############################################################################### |
70 | 70 |
71 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked'); | 71 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked'); |
72 like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering'); | 72 like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering'); |
75 ############################################################################### | 75 ############################################################################### |
76 | 76 |
77 sub http_chunked_daemon { | 77 sub http_chunked_daemon { |
78 my $server = IO::Socket::INET->new( | 78 my $server = IO::Socket::INET->new( |
79 Proto => 'tcp', | 79 Proto => 'tcp', |
80 LocalAddr => '127.0.0.1:8081', | 80 LocalAddr => '127.0.0.1:' . port(1), |
81 Listen => 5, | 81 Listen => 5, |
82 Reuse => 1 | 82 Reuse => 1 |
83 ) | 83 ) |
84 or die "Can't create listening socket: $!\n"; | 84 or die "Can't create listening socket: $!\n"; |
85 | 85 |