[master] 7a883dc57 shard director: improve alt parameter test coverage

Nils Goroll nils.goroll at uplex.de
Tue Dec 3 14:42:06 UTC 2019


commit 7a883dc5744f5dd225c9501c010c71d8c1b5e9a6
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Dec 3 15:35:35 2019 +0100

    shard director: improve alt parameter test coverage

diff --git a/bin/varnishtest/tests/d00022.vtc b/bin/varnishtest/tests/d00022.vtc
index 9344234b7..e8cf95a5c 100644
--- a/bin/varnishtest/tests/d00022.vtc
+++ b/bin/varnishtest/tests/d00022.vtc
@@ -67,6 +67,13 @@ varnish v1 -vcl+backend {
 		if (req.http.vrstart) {
 			return(restart);
 		}
+
+		set resp.http.all-alt-0 = vd.backend(by=KEY, key=1756955383, alt=0, healthy=ALL);
+		set resp.http.all-alt-1 = vd.backend(by=KEY, key=1756955383, alt=1, healthy=ALL);
+		set resp.http.all-alt-2 = vd.backend(by=KEY, key=1756955383, alt=2, healthy=ALL);
+		set resp.http.chosen-alt-0 = vd.backend(by=KEY, key=1756955383, alt=0, healthy=CHOSEN);
+		set resp.http.chosen-alt-1 = vd.backend(by=KEY, key=1756955383, alt=1, healthy=CHOSEN);
+		set resp.http.chosen-alt-2 = vd.backend(by=KEY, key=1756955383, alt=2, healthy=CHOSEN);
 	}
 
 } -start
@@ -76,12 +83,30 @@ client c1 {
 	txreq -url /1
 	rxresp
 	expect resp.body == "ech3Ooj"
+	expect resp.http.all-alt-0 == "s1"
+	expect resp.http.all-alt-1 == "s2"
+	expect resp.http.all-alt-2 == "s3"
+	expect resp.http.chosen-alt-0 == "s1"
+	expect resp.http.chosen-alt-1 == "s2"
+	expect resp.http.chosen-alt-2 == "s3"
 
 	txreq -url /2 -hdr "vrstart: 1"
 	rxresp
 	expect resp.body == "ieQu2qua"
+	expect resp.http.all-alt-0 == "s1"
+	expect resp.http.all-alt-1 == "s2"
+	expect resp.http.all-alt-2 == "s3"
+	expect resp.http.chosen-alt-0 == "s1"
+	expect resp.http.chosen-alt-1 == "s2"
+	expect resp.http.chosen-alt-2 == "s3"
 
 	txreq -url /3 -hdr "vrstart: 1"
 	rxresp
 	expect resp.body == "xiuFi3Pe"
+	expect resp.http.all-alt-0 == "s1"
+	expect resp.http.all-alt-1 == "s2"
+	expect resp.http.all-alt-2 == "s3"
+	expect resp.http.chosen-alt-0 == "s1"
+	expect resp.http.chosen-alt-1 == "s2"
+	expect resp.http.chosen-alt-2 == "s3"
 } -run


More information about the varnish-commit mailing list