[master] 096505549 Also fix "loopback" ip# in d00007, with a slight cheat.

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 27 08:50:06 UTC 2023


commit 0965055497beab488a1e6743131a7d7731d10e5a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 27 08:49:16 2023 +0000

    Also fix "loopback" ip# in d00007, with a slight cheat.

diff --git a/bin/varnishtest/tests/d00007.vtc b/bin/varnishtest/tests/d00007.vtc
index b119d9cc2..9443010f9 100644
--- a/bin/varnishtest/tests/d00007.vtc
+++ b/bin/varnishtest/tests/d00007.vtc
@@ -1,34 +1,5 @@
 varnishtest "Test dynamic backends"
 
-server s1 {
-	rxreq
-	expect req.url == "/"
-	expect req.http.Probe == "p1"
-	expect req.http.Authority == <undef>
-	txresp
-	close
-	accept
-	rxreq
-	expect req.url == "/1"
-	expect req.http.Probe == <undef>
-	expect req.http.Authority == <undef>
-	txresp
-	close
-	accept
-	rxreq
-	expect req.url == "/"
-	expect req.http.Probe == "p2"
-	expect req.http.Authority == "127.0.0.1"
-	txresp
-	close
-	accept
-	rxreq
-	expect req.url == "/2"
-	expect req.http.Probe == <undef>
-	expect req.http.Authority == "127.0.0.1"
-	txresp
-} -start
-
 # the use case for via-proxy is to have a(n ha)proxy make a(n ssl)
 # connection on our behalf. For the purpose of testing, we use another
 # varnish in place - but we are behaving realistically in that we do
@@ -58,6 +29,40 @@ varnish v2 -proto PROXY -vcl {
 	}
 } -start
 
+
+# NB: ${v2_addr} in s1's work should really be ${s1_addr}, but it is not
+#     defined until after the (implicit) listen(2) call, so we cheat
+#     and use v2's address instead.
+
+server s1 {
+	rxreq
+	expect req.url == "/"
+	expect req.http.Probe == "p1"
+	expect req.http.Authority == <undef>
+	txresp
+	close
+	accept
+	rxreq
+	expect req.url == "/1"
+	expect req.http.Probe == <undef>
+	expect req.http.Authority == <undef>
+	txresp
+	close
+	accept
+	rxreq
+	expect req.url == "/"
+	expect req.http.Probe == "p2"
+	expect req.http.Authority == "${v2_addr}"
+	txresp
+	close
+	accept
+	rxreq
+	expect req.url == "/2"
+	expect req.http.Probe == <undef>
+	expect req.http.Authority == "${v2_addr}"
+	txresp
+} -start
+
 #
 # we vtc.sleep to make sure that the health check is done and server
 # s1 has accepted again. We would rather want to use barriers, but
@@ -122,5 +127,5 @@ client c1 {
 	txreq -url /2
 	rxresp
 	expect resp.status == 200
-	expect resp.http.Authority == "127.0.0.1"
+	expect resp.http.Authority == "${s1_addr}"
 } -run


More information about the varnish-commit mailing list