diff scgi.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 eca9b1d19021
children d4a0232425ee
line wrap: on
line diff
--- a/scgi.t
+++ b/scgi.t
@@ -38,15 +38,15 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     upstream u {
-        server 127.0.0.1:8081;
+        server 127.0.0.1:%%PORT_1%%;
     }
 
     server {
-        listen       127.0.0.1:8080;
+        listen       127.0.0.1:%%PORT_0%%;
         server_name  localhost;
 
         location / {
-            scgi_pass 127.0.0.1:8081;
+            scgi_pass 127.0.0.1:%%PORT_1%%;
             scgi_param SCGI 1;
             scgi_param REQUEST_URI $request_uri;
             scgi_param HTTP_X_BLAH "blah";
@@ -77,7 +77,8 @@ unlike(http_head('/'), qr/SEE-THIS/, 'no
 like(http_get_headers('/headers'), qr/SEE-THIS/,
 	'scgi request with many ignored headers');
 
-like(http_get('/var?b=127.0.0.1:8081'), qr/SEE-THIS/, 'scgi with variables');
+like(http_get('/var?b=127.0.0.1:' . port(1)), qr/SEE-THIS/,
+	'scgi with variables');
 like(http_get('/var?b=u'), qr/SEE-THIS/, 'scgi with variables to upstream');
 
 ###############################################################################
@@ -115,7 +116,7 @@ EOF
 sub scgi_daemon {
 	my $server = IO::Socket::INET->new(
 		Proto => 'tcp',
-		LocalHost => '127.0.0.1:8081',
+		LocalHost => '127.0.0.1:' . port(1),
 		Listen => 5,
 		Reuse => 1
 	)
@@ -129,7 +130,7 @@ sub scgi_daemon {
 		$request->read_env();
 
 		$request->connection()->print(<<EOF);
-Location: http://127.0.0.1:8080/redirect
+Location: http://localhost/redirect
 Content-Type: text/html
 
 SEE-THIS