# HG changeset patch # User Sergey Kandaurov # Date 1541591376 -10800 # Node ID dab8b525221662712e7f5830493970053cdaf0a8 # Parent 62f06d8dfc63b8c8fd5dba3509ed3eba11e1ecee Tests: added upstream ip_hash test with single peer. diff --git a/upstream_ip_hash.t b/upstream_ip_hash.t --- 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'); ###############################################################################