comparison fastcgi_body.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 6bb1f2ccd386
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
33 33
34 http { 34 http {
35 %%TEST_GLOBALS_HTTP%% 35 %%TEST_GLOBALS_HTTP%%
36 36
37 server { 37 server {
38 listen 127.0.0.1:8080; 38 listen 127.0.0.1:%%PORT_0%%;
39 server_name localhost; 39 server_name localhost;
40 40
41 location / { 41 location / {
42 fastcgi_pass 127.0.0.1:8081; 42 fastcgi_pass 127.0.0.1:%%PORT_1%%;
43 fastcgi_param REQUEST_URI $request_uri; 43 fastcgi_param REQUEST_URI $request_uri;
44 fastcgi_param CONTENT_LENGTH $content_length; 44 fastcgi_param CONTENT_LENGTH $content_length;
45 } 45 }
46 } 46 }
47 } 47 }
48 48
49 EOF 49 EOF
50 50
51 $t->run_daemon(\&fastcgi_daemon); 51 $t->run_daemon(\&fastcgi_daemon);
52 $t->run()->waitforsocket('127.0.0.1:8081'); 52 $t->run()->waitforsocket('127.0.0.1:' . port(1));
53 53
54 ############################################################################### 54 ###############################################################################
55 55
56 like(http_get('/'), qr/X-Body: _eos\x0d?$/ms, 'fastcgi no body'); 56 like(http_get('/'), qr/X-Body: _eos\x0d?$/ms, 'fastcgi no body');
57 57
139 } 139 }
140 140
141 sub fastcgi_daemon { 141 sub fastcgi_daemon {
142 my $server = IO::Socket::INET->new( 142 my $server = IO::Socket::INET->new(
143 Proto => 'tcp', 143 Proto => 'tcp',
144 LocalAddr => '127.0.0.1:8081', 144 LocalAddr => '127.0.0.1:' . port(1),
145 Listen => 5, 145 Listen => 5,
146 Reuse => 1 146 Reuse => 1
147 ) 147 )
148 or die "Can't create listening socket: $!\n"; 148 or die "Can't create listening socket: $!\n";
149 149
174 } 174 }
175 } 175 }
176 176
177 # respond 177 # respond
178 fastcgi_respond($client, $version, $id, <<EOF); 178 fastcgi_respond($client, $version, $id, <<EOF);
179 Location: http://127.0.0.1:8080/redirect 179 Location: http://localhost/redirect
180 Content-Type: text/html 180 Content-Type: text/html
181 X-Body: $body 181 X-Body: $body
182 182
183 SEE-THIS 183 SEE-THIS
184 EOF 184 EOF