diff proxy_next_upstream_tries.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 b1fa8e0cc27b
children 882267679006
line wrap: on
line diff
--- a/proxy_next_upstream_tries.t
+++ b/proxy_next_upstream_tries.t
@@ -38,19 +38,19 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     upstream u {
-        server 127.0.0.1:8081;
-        server 127.0.0.1:8081;
-        server 127.0.0.1:8081;
+        server 127.0.0.1:%%PORT_1%%;
+        server 127.0.0.1:%%PORT_1%%;
+        server 127.0.0.1:%%PORT_1%%;
     }
 
     upstream u2 {
-        server 127.0.0.1:8081;
-        server 127.0.0.1:8081 backup;
-        server 127.0.0.1:8081 backup;
+        server 127.0.0.1:%%PORT_1%%;
+        server 127.0.0.1:%%PORT_1%% backup;
+        server 127.0.0.1:%%PORT_1%% backup;
     }
 
     server {
-        listen       127.0.0.1:8080;
+        listen       127.0.0.1:%%PORT_0%%;
         server_name  localhost;
 
         proxy_next_upstream http_404;
@@ -68,9 +68,9 @@ http {
         }
 
         location /tries/resolver {
-            resolver 127.0.0.1:8083;
+            resolver 127.0.0.1:%%PORT_2_UDP%%;
 
-            proxy_pass http://$host:8081;
+            proxy_pass http://$host:%%PORT_1%%;
             proxy_next_upstream_tries 2;
         }
 
@@ -90,9 +90,9 @@ http {
         }
 
         location /timeout/resolver {
-            resolver 127.0.0.1:8083;
+            resolver 127.0.0.1:%%PORT_2_UDP%%;
 
-            proxy_pass http://$host:8081/w2;
+            proxy_pass http://$host:%%PORT_1%%/w2;
             proxy_next_upstream_timeout 3800ms;
         }
 
@@ -109,12 +109,12 @@ http {
 
 EOF
 
-$t->run_daemon(\&http_daemon, 8081);
-$t->run_daemon(\&dns_daemon, 8083, $t);
+$t->run_daemon(\&http_daemon, port(1));
+$t->run_daemon(\&dns_daemon, port(2), $t);
 $t->run();
 
-$t->waitforsocket('127.0.0.1:8081');
-$t->waitforfile($t->testdir . '/8083');
+$t->waitforsocket('127.0.0.1:' . port(1));
+$t->waitforfile($t->testdir . '/' . port(2));
 
 ###############################################################################