Tests: added upstream ip_hash test with single peer.
diff --git a/upstream_ip_hash.t b/upstream_ip_hash.t
index de254ee..2516a83 100644
--- a/upstream_ip_hash.t
+++ b/upstream_ip_hash.t
@@ -49,6 +49,11 @@
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 @@
location /u2 {
proxy_pass http://u2;
}
+ location /s {
+ proxy_pass http://s;
+ }
}
server {
@@ -82,7 +90,7 @@
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 @@
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');
###############################################################################