changeset 1392:dab8b5252216

Tests: added upstream ip_hash test with single peer.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 07 Nov 2018 14:49:36 +0300
parents 62f06d8dfc63
children 23cf08e9d2a2
files upstream_ip_hash.t
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/upstream_ip_hash.t
+++ b/upstream_ip_hash.t
@@ -49,6 +49,11 @@ http {
         server 127.0.0.1:8083;
     }
 
+    upstream s {
+        ip_hash;
+        server 127.0.0.1:8081;
+    }
+
     server {
         listen       127.0.0.1:8080;
         server_name  localhost;
@@ -62,6 +67,9 @@ http {
         location /u2 {
             proxy_pass http://u2;
         }
+        location /s {
+            proxy_pass http://s;
+        }
     }
 
     server {
@@ -82,7 +90,7 @@ EOF
 plan(skip_all => 'no 127.0.0.1 on host')
 	if http_get('/') !~ /X-IP: 127.0.0.1/m;
 
-$t->plan(2);
+$t->plan(3);
 
 ###############################################################################
 
@@ -90,6 +98,7 @@ my @ports = my ($port1, $port2, $port3) 
 
 is(many('/', 30), "$port1: 15, $port2: 15", 'ip_hash');
 is(many('/u2', 30), "$port1: 10, $port2: 10, $port3: 10", 'ip_hash 3 peers');
+is(many('/s', 30), "$port1: 30", 'ip_hash single peer');
 
 ###############################################################################