changeset 493:d456ed8a18de

Tests: added proxy_next_upstream_tries.t tests with zero value.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 07 Nov 2014 15:11:18 +0300
parents 799487ee9aee
children 623863fcb1d1
files proxy_next_upstream_tries.t
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_next_upstream_tries.t
+++ b/proxy_next_upstream_tries.t
@@ -87,6 +87,11 @@ http {
             proxy_next_upstream_tries 2;
         }
 
+        location /tries/zero {
+            proxy_pass http://u;
+            proxy_next_upstream_tries 0;
+        }
+
         location /timeout {
             proxy_pass http://u3;
             proxy_next_upstream_timeout 1900ms;
@@ -105,6 +110,11 @@ http {
             proxy_next_upstream_timeout 1900ms;
         }
 
+        location /timeout/zero {
+            proxy_pass http://u3;
+            proxy_next_upstream_timeout 0;
+        }
+
         location /404 {
             return 200 x${upstream_status}x;
         }
@@ -116,7 +126,7 @@ EOF
 $t->run_daemon(\&http_daemon, 8081);
 $t->run_daemon(\&http_daemon, 8082);
 $t->run_daemon(\&dns_daemon, 8083, $t);
-$t->try_run('no proxy_next_upstream_tries')->plan(6);
+$t->try_run('no proxy_next_upstream_tries')->plan(8);
 
 $t->waitforsocket('127.0.0.1:8081');
 $t->waitforsocket('127.0.0.1:8082');
@@ -134,6 +144,8 @@ like(http_get('/tries/resolver'), qr/x40
 
 }
 
+like(http_get('/tries/zero'), qr/x404, 404, 404x/, 'tries zero');
+
 # two tries fit into 1.9s
 
 like(http_get('/timeout'), qr/x404, 404x/, 'timeout');
@@ -146,6 +158,8 @@ like(http_get('/timeout/resolver'), qr/x
 
 }
 
+like(http_get('/timeout/zero'), qr/x404, 404, 404x/, 'timeout zero');
+
 ###############################################################################
 
 sub http_daemon {