Mercurial > hg > nginx-tests
comparison proxy_keepalive.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 | 8f6b9f7f36d7 |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
951:9361c7eddfc1 | 952:e9064d691790 |
---|---|
36 | 36 |
37 http { | 37 http { |
38 %%TEST_GLOBALS_HTTP%% | 38 %%TEST_GLOBALS_HTTP%% |
39 | 39 |
40 upstream backend { | 40 upstream backend { |
41 server 127.0.0.1:8081; | 41 server 127.0.0.1:%%PORT_1%%; |
42 keepalive 1; | 42 keepalive 1; |
43 } | 43 } |
44 | 44 |
45 server { | 45 server { |
46 listen 127.0.0.1:8080; | 46 listen 127.0.0.1:%%PORT_0%%; |
47 server_name localhost; | 47 server_name localhost; |
48 | 48 |
49 proxy_http_version 1.1; | 49 proxy_http_version 1.1; |
50 proxy_set_header Connection ""; | 50 proxy_set_header Connection ""; |
51 | 51 |
72 'set: <!--#echo var="x" -->'); | 72 'set: <!--#echo var="x" -->'); |
73 | 73 |
74 $t->run_daemon(\&http_daemon); | 74 $t->run_daemon(\&http_daemon); |
75 $t->run(); | 75 $t->run(); |
76 | 76 |
77 $t->waitforsocket('127.0.0.1:8081') | 77 $t->waitforsocket('127.0.0.1:' . port(1)) |
78 or die "Can't start test backend"; | 78 or die "Can't start test backend"; |
79 | 79 |
80 ############################################################################### | 80 ############################################################################### |
81 | 81 |
82 # There are 3 mostly independent modes of upstream operation: | 82 # There are 3 mostly independent modes of upstream operation: |
213 ############################################################################### | 213 ############################################################################### |
214 | 214 |
215 sub http_daemon { | 215 sub http_daemon { |
216 my $server = IO::Socket::INET->new( | 216 my $server = IO::Socket::INET->new( |
217 Proto => 'tcp', | 217 Proto => 'tcp', |
218 LocalHost => '127.0.0.1:8081', | 218 LocalHost => '127.0.0.1:' . port(1), |
219 Listen => 5, | 219 Listen => 5, |
220 Reuse => 1 | 220 Reuse => 1 |
221 ) | 221 ) |
222 or die "Can't create listening socket: $!\n"; | 222 or die "Can't create listening socket: $!\n"; |
223 | 223 |