[6.0] d83e25bd7 Test more of the fallback director

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jul 11 09:35:12 UTC 2019


commit d83e25bd7402818191872b089c3c4f30c3657c3b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 21 09:50:17 2019 +0000

    Test more of the fallback director

diff --git a/bin/varnishtest/tests/d00001.vtc b/bin/varnishtest/tests/d00001.vtc
index 405147615..1ebae04d2 100644
--- a/bin/varnishtest/tests/d00001.vtc
+++ b/bin/varnishtest/tests/d00001.vtc
@@ -16,6 +16,7 @@ server s3 {
 } -start
 
 varnish v1 -vcl+backend {
+	import std;
 	import directors;
 
 	sub vcl_init {
@@ -33,11 +34,17 @@ varnish v1 -vcl+backend {
 		return (pass);
 	}
 
+	sub vcl_deliver {
+		set resp.http.health = std.healthy(fb1.backend());
+	}
+
 	sub vcl_backend_fetch {
 		set bereq.backend = fb1.backend();
 	}
 } -start
 
+varnish v1 -cliok "param.set debug +vclrel"
+
 varnish v1 -cliok "backend.set_health s1 sick"
 varnish v1 -cliok "backend.set_health s2 sick"
 
@@ -48,6 +55,8 @@ client c1 {
 	expect resp.http.foo == "3"
 } -run
 
+varnish v1 -vsl_catchup
+
 varnish v1 -cliok "backend.set_health s2 healthy"
 
 client c1 {
@@ -56,6 +65,8 @@ client c1 {
 	expect resp.http.foo == "2"
 } -run
 
+varnish v1 -vsl_catchup
+
 varnish v1 -cliok "backend.set_health s1 healthy"
 
 client c1 {
@@ -64,6 +75,8 @@ client c1 {
 	expect resp.http.foo == "1"
 } -run
 
+varnish v1 -vsl_catchup
+
 varnish v1 -cliok "backend.set_health s1 sick"
 server s3 -start
 
@@ -75,3 +88,15 @@ client c1 {
 	rxresp
 	expect resp.http.foo == "3"
 } -run
+
+varnish v1 -vsl_catchup
+
+varnish v1 -vcl+backend {
+	sub vcl_recv {
+		set req.backend_hint = s1;
+		set req.backend_hint = s2;
+		set req.backend_hint = s3;
+	}
+}
+varnish v1 -cliok "vcl.discard vcl1"
+varnish v1 -cliok "vcl.list"


More information about the varnish-commit mailing list