diff fastcgi_body2.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
line wrap: on
line diff
--- a/fastcgi_body2.t
+++ b/fastcgi_body2.t
@@ -42,12 +42,12 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     upstream u {
-        server 127.0.0.1:8081 max_fails=0;
-        server 127.0.0.1:8082;
+        server 127.0.0.1:%%PORT_1%% max_fails=0;
+        server 127.0.0.1:%%PORT_2%%;
     }
 
     server {
-        listen       127.0.0.1:8080;
+        listen       127.0.0.1:%%PORT_0%%;
         server_name  localhost;
 
         location / {
@@ -71,12 +71,12 @@ http {
 
 EOF
 
-$t->run_daemon(\&fastcgi_daemon, 8081);
-$t->run_daemon(\&fastcgi_daemon, 8082);
+$t->run_daemon(\&fastcgi_daemon, port(1));
+$t->run_daemon(\&fastcgi_daemon, port(2));
 $t->run();
 
-$t->waitforsocket('127.0.0.1:8081');
-$t->waitforsocket('127.0.0.1:8082');
+$t->waitforsocket('127.0.0.1:' . port(1));
+$t->waitforsocket('127.0.0.1:' . port(2));
 
 ###############################################################################
 
@@ -116,10 +116,10 @@ sub fastcgi_daemon {
 		read(STDIN, my $body, $ENV{'CONTENT_LENGTH'});
 		my $len = length $body;
 
-		sleep 3 if $port == 8081;
+		sleep 3 if $port == port(1);
 
 		print <<EOF;
-Location: http://127.0.0.1:8080/redirect
+Location: http://localhost/redirect
 Content-Type: text/html
 X-Length: $len