[6.0] f051dddd0 vtc: Do not resolve localhost in test cases

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Jun 21 13:43:13 UTC 2024


commit f051dddd06ed75bb8471116cd5d633f84f3e63f2
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Jun 19 09:58:50 2024 +0200

    vtc: Do not resolve localhost in test cases

diff --git a/bin/varnishtest/tests/c00003.vtc b/bin/varnishtest/tests/c00003.vtc
index 1c369bb07..5028313ab 100644
--- a/bin/varnishtest/tests/c00003.vtc
+++ b/bin/varnishtest/tests/c00003.vtc
@@ -3,11 +3,11 @@ varnishtest "Check that we fail to start with erroneous -a/-b arguments"
 # Duplicate -a arguments
 # XXX: this cannot be tested reliably, we tolerate port collision
 shell -err -match "have same address|already in use" {
-	varnishd -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80
+	varnishd -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b ${localhost}:80
 }
 
 shell -err -match "have same address|already in use" {
-	varnishd -d -a ${tmpdir}/vtc.sock -a ${tmpdir}/vtc.sock -b localhost:80
+	varnishd -d -a ${tmpdir}/vtc.sock -a ${tmpdir}/vtc.sock -b ${localhost}:80
 }
 
 # -a bad protocol specs
diff --git a/bin/varnishtest/tests/s00005.vtc b/bin/varnishtest/tests/s00005.vtc
index 4dac2f167..37f56a2bc 100644
--- a/bin/varnishtest/tests/s00005.vtc
+++ b/bin/varnishtest/tests/s00005.vtc
@@ -8,9 +8,9 @@ server s1 {
 varnish v1 -vcl+backend {}
 
 # VCL name must be C-names
-varnish v1 -clierr 106 {vcl.inline 0000 "vcl 4.0; backend b { .host = \"localhost\";} "}
-varnish v1 -clierr 106 {vcl.inline a00/ "vcl 4.0; backend b { .host = \"localhost\";} "}
-varnish v1 -clierr 106 {vcl.inline a00å "vcl 4.0; backend b { .host = \"localhost\";} "}
+varnish v1 -clierr 106 {vcl.inline 0000 "vcl 4.0; backend b { .host = \"${localhost}\";} "}
+varnish v1 -clierr 106 {vcl.inline a00/ "vcl 4.0; backend b { .host = \"${localhost}\";} "}
+varnish v1 -clierr 106 {vcl.inline a00å "vcl 4.0; backend b { .host = \"${localhost}\";} "}
 
 varnish v1 -vcl+backend {
 	sub vcl_recv {
diff --git a/bin/varnishtest/tests/v00049.vtc b/bin/varnishtest/tests/v00049.vtc
index 53e2cb705..c2d497109 100644
--- a/bin/varnishtest/tests/v00049.vtc
+++ b/bin/varnishtest/tests/v00049.vtc
@@ -17,11 +17,11 @@ varnish v1 -syntax 4.0 -errvcl "VCL version 9.9 not supported" {
 }
 
 varnish v1 -cliexpect {Don't play silly buggers with VCL version numbers} \
-	{vcl.inline t0 "vcl 4.00 ; backend b { .host = \"localhost\";} "}
+	{vcl.inline t0 "vcl 4.00 ; backend b { .host = \"${localhost}\";} "}
 
 varnish v1 -cliexpect {Don't play silly buggers with VCL version numbers} \
-	{vcl.inline t1 "vcl 04.0 ; backend b { .host = \"localhost\";} "}
+	{vcl.inline t1 "vcl 04.0 ; backend b { .host = \"${localhost}\";} "}
 
 varnish v1 -cliexpect {Expected 'vcl N.N;' found no semi-colon} \
-	{vcl.inline t2 "vcl 4.0  backend b { .host = \"localhost\";} "}
+	{vcl.inline t2 "vcl 4.0  backend b { .host = \"${localhost}\";} "}
 


More information about the varnish-commit mailing list