[master] 069311348 vtc: Make tests compatible with IPv6 only

Nils Goroll nils.goroll at uplex.de
Sat Jan 9 20:17:15 UTC 2021


commit 06931134800b88da228402ad64e13d668819f8b9
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Jan 9 14:59:28 2021 +0100

    vtc: Make tests compatible with IPv6 only
    
    For 127.0.0.1, use "None", "${localhost}" or "${bind_addr}" as appropriate.
    
    Instead of ${Xaddr}:${Xport}, use ${Xsock}
    
    For some tests, we need to add a Host header to make them stable for
    differing server addresses.
    
    Ref #3490

diff --git a/bin/varnishtest/tests/a02022.vtc b/bin/varnishtest/tests/a02022.vtc
index d3cc0d01b..c089cd6a6 100644
--- a/bin/varnishtest/tests/a02022.vtc
+++ b/bin/varnishtest/tests/a02022.vtc
@@ -20,4 +20,4 @@ server s1 {
 
 } -start
 
-shell { nghttp http://${s1_addr}:${s1_port} -nu }
+shell { nghttp http://${s1_sock} -nu }
diff --git a/bin/varnishtest/tests/b00032.vtc b/bin/varnishtest/tests/b00032.vtc
index d395fef69..7fd326289 100644
--- a/bin/varnishtest/tests/b00032.vtc
+++ b/bin/varnishtest/tests/b00032.vtc
@@ -25,7 +25,7 @@ varnish v1 -clierr 300 "vcl.discard vcl1"
 
 varnish v1 -clierr 106 "vcl.discard vcl0"
 
-varnish v1 -clierr 106 {vcl.inline vcl2 "vcl 4.0; backend foo {.host = \"127.0.0.1\";} "}
+varnish v1 -clierr 106 {vcl.inline vcl2 "vcl 4.0; backend foo {.host = \"${localhost}\";} "}
 
 varnish v1 -clierr 106 {vcl.load vcl3 ./nonexistent.vcl}
 
diff --git a/bin/varnishtest/tests/b00041.vtc b/bin/varnishtest/tests/b00041.vtc
index ca66c4539..b829efc17 100644
--- a/bin/varnishtest/tests/b00041.vtc
+++ b/bin/varnishtest/tests/b00041.vtc
@@ -1,6 +1,6 @@
 varnishtest "Test varnishadm and the Telnet CLI"
 
-varnish v1 -vcl {backend foo { .host = "127.0.0.1"; } } -start
+varnish v1 -vcl {backend foo { .host = "${localhost}"; } } -start
 
 shell -err -expect {Usage: varnishadm} \
 	"varnishadm -7"
@@ -16,7 +16,7 @@ server s1 {
 } -start
 
 shell -err -expect {Rejected 400} \
-	{varnishadm -T ${s1_addr}:${s1_port} -S /etc/group}
+	{varnishadm -T ${s1_sock} -S /etc/group}
 
 server s1 {
 	send "107 59      \n"
@@ -26,7 +26,7 @@ server s1 {
 } -start
 
 shell -err -expect {Authentication required} \
-	{varnishadm -T ${s1_addr}:${s1_port}}
+	{varnishadm -T ${s1_sock}}
 
 server s1 {
 	send "107 59      \n"
@@ -36,7 +36,7 @@ server s1 {
 } -start
 
 shell -err -expect {Cannot open } \
-	{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.nonexistent}
+	{varnishadm -T ${s1_sock} -S ${v1_name}/_.nonexistent}
 
 server s1 {
 	send "107 59      \n"
@@ -50,7 +50,7 @@ server s1 {
 } -start
 
 shell -err -expect {Rejected 599} \
-	{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret}
+	{varnishadm -T ${s1_sock} -S ${v1_name}/_.secret}
 
 server s1 {
 	send "107 59      \n"
@@ -66,7 +66,7 @@ server s1 {
 } -start
 
 shell -err -expect {No pong received from server} \
-	{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret}
+	{varnishadm -T ${s1_sock} -S ${v1_name}/_.secret}
 
 server s1 {
 	send "107 59      \n"
@@ -90,6 +90,6 @@ server s1 {
 } -start
 
 shell -expect {Tested} \
-	{varnishadm -T ${s1_addr}:${s1_port} -S ${v1_name}/_.secret test}
+	{varnishadm -T ${s1_sock} -S ${v1_name}/_.secret test}
 
 shell "varnishadm -n ${v1_name} help > /dev/null"
diff --git a/bin/varnishtest/tests/b00042.vtc b/bin/varnishtest/tests/b00042.vtc
index 6470a7260..6c338ae51 100644
--- a/bin/varnishtest/tests/b00042.vtc
+++ b/bin/varnishtest/tests/b00042.vtc
@@ -1,6 +1,6 @@
 varnishtest "param edge cases"
 
-varnish v1 -vcl {backend foo {.host = "127.0.0.1";}} -start
+varnish v1 -vcl {backend foo {.host = "${localhost}";}} -start
 
 
 varnish v1 -clierr "106" "param.set default_ttl -1"
diff --git a/bin/varnishtest/tests/b00045.vtc b/bin/varnishtest/tests/b00045.vtc
index 47a676f07..c687f2d49 100644
--- a/bin/varnishtest/tests/b00045.vtc
+++ b/bin/varnishtest/tests/b00045.vtc
@@ -15,13 +15,13 @@ client c1 {
 delay .2
 
 shell -err -expect {Error: Could not open pid-file} {
-	varnishd -P /dev/tty -b 127.0.0.1:80 -a :0 -n ${tmpdir}
+	varnishd -P /dev/tty -b None -a :0 -n ${tmpdir}
 }
 
 shell -err -expect {Error: Varnishd is already running} {
-	varnishd -P ${v1_name}/varnishd.pid -b 127.0.0.1:80 -a :0 -n ${tmpdir}
+	varnishd -P ${v1_name}/varnishd.pid -b None -a :0 -n ${tmpdir}
 }
 
 shell -err -expect {Error: Varnishd is already running} {
-	varnishd -b 127.0.0.1:80 -a:0 -n ${tmpdir}/v1 -F
+	varnishd -b None -a:0 -n ${tmpdir}/v1 -F
 }
diff --git a/bin/varnishtest/tests/b00053.vtc b/bin/varnishtest/tests/b00053.vtc
index 6e7f8301b..1c9bf152b 100644
--- a/bin/varnishtest/tests/b00053.vtc
+++ b/bin/varnishtest/tests/b00053.vtc
@@ -5,7 +5,7 @@ server s1 -listen "${tmpdir}/s1.sock" {
 	txresp -body "012345\n"
 } -start
 
-varnish v1 -arg "-a ${tmpdir}/v1.sock -a ${localhost}:0" -vcl+backend {
+varnish v1 -arg "-a ${tmpdir}/v1.sock -a ${listen_addr}" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 	}
diff --git a/bin/varnishtest/tests/b00067.vtc b/bin/varnishtest/tests/b00067.vtc
index 9479617a8..786ddcd93 100644
--- a/bin/varnishtest/tests/b00067.vtc
+++ b/bin/varnishtest/tests/b00067.vtc
@@ -1,7 +1,7 @@
 varnishtest "Check timeout_idle"
 
 varnish v1 -arg "-p timeout_idle=1"	\
-	   -arg "-a 127.0.0.1:0"	\
+	   -arg "-a ${listen_addr}"	\
 	   -arg "-a ${tmpdir}/v1.sock"	\
 	   -vcl {
 	backend dummy { .host = "${bad_backend}"; }
diff --git a/bin/varnishtest/tests/b00068.vtc b/bin/varnishtest/tests/b00068.vtc
index 2251b5290..dea15e802 100644
--- a/bin/varnishtest/tests/b00068.vtc
+++ b/bin/varnishtest/tests/b00068.vtc
@@ -8,7 +8,7 @@ varnishtest "Check timeout_linger"
 #
 
 varnish v1 -arg "-p timeout_linger=1"	\
-	   -arg "-a 127.0.0.1:0"	\
+	   -arg "-a ${listen_addr}"	\
 	   -arg "-a ${tmpdir}/v1.sock"	\
 	   -vcl {
 	import std;
diff --git a/bin/varnishtest/tests/c00003.vtc b/bin/varnishtest/tests/c00003.vtc
index d5a8ef9d4..5c3b7fabd 100644
--- a/bin/varnishtest/tests/c00003.vtc
+++ b/bin/varnishtest/tests/c00003.vtc
@@ -3,19 +3,23 @@ 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|Address in use" {
-	varnishd -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80
+	if echo "${localhost}" | grep ":" >/dev/null ; then
+		varnishd -d -a "[${localhost}]":38484 -a "[${localhost}]":38484 -b None
+	else
+		varnishd -d -a ${localhost}:38484 -a ${localhost}:38484 -b None
+	fi
 }
 
 shell -err -match "have same address|already in use|Address 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 None
 }
 
 # -a bad protocol specs
 shell -err -expect "Too many protocol sub-args" {
-	varnishd -a 127.0.0.1:80000,PROXY,FOO -d
+	varnishd -a ${localhost}:80000,PROXY,FOO -d
 }
 shell -err -expect "Too many protocol sub-args" {
-	varnishd -a 127.0.0.1:80000,HTTP,FOO -d
+	varnishd -a ${localhost}:80000,HTTP,FOO -d
 }
 
 # -a UDS path too long
@@ -30,15 +34,15 @@ shell -err -expect "Unix domain socket addresses must be absolute paths" {
 
 # -a args for UDS permissions not permitted with IP addresses
 shell -err -expect "Invalid sub-arg user=u for IP addresses" {
-	varnishd -a 127.0.0.1:80000,user=u -d
+	varnishd -a ${localhost}:80000,user=u -d
 }
 
 shell -err -expect "Invalid sub-arg group=g for IP addresses" {
-	varnishd -a 127.0.0.1:80000,group=g -d
+	varnishd -a ${localhost}:80000,group=g -d
 }
 
 shell -err -expect "Invalid sub-arg mode=660 for IP addresses" {
-	varnishd -a 127.0.0.1:80000,mode=660 -d
+	varnishd -a ${localhost}:80000,mode=660 -d
 }
 
 # Illegal mode sub-args
@@ -123,5 +127,5 @@ shell -err -expect "Error: Could not get socket" {
 
 # old style address list
 shell -err -expect "Unknown protocol" {
-	varnishd -F -a "127.0.0.1:0,${bad_ip}:0" -b '***' -n ${tmpdir}
+	varnishd -F -a "${listen_addr},${bad_ip}:0" -b '***' -n ${tmpdir}
 }
diff --git a/bin/varnishtest/tests/c00005.vtc b/bin/varnishtest/tests/c00005.vtc
index a39d5ee04..448d6f80c 100644
--- a/bin/varnishtest/tests/c00005.vtc
+++ b/bin/varnishtest/tests/c00005.vtc
@@ -19,7 +19,7 @@ varnish v1 -errvcl {Name acl1 must have type 'acl'.} {
 	}
 
 	backend acl1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 	}
 }
 
diff --git a/bin/varnishtest/tests/c00007.vtc b/bin/varnishtest/tests/c00007.vtc
index 016ae78e2..ec780cec2 100644
--- a/bin/varnishtest/tests/c00007.vtc
+++ b/bin/varnishtest/tests/c00007.vtc
@@ -1,5 +1,5 @@
 varnishtest "Test banning a hash"
 
-varnish v1 -arg "-b 127.0.0.1:80" -start
+varnish v1 -arg "-b None" -start
 
 varnish v1 -clierr 101 "ban.hash foo"
diff --git a/bin/varnishtest/tests/c00039.vtc b/bin/varnishtest/tests/c00039.vtc
index 4c36c2ac2..c7350219d 100644
--- a/bin/varnishtest/tests/c00039.vtc
+++ b/bin/varnishtest/tests/c00039.vtc
@@ -21,19 +21,19 @@ varnish v1 -cliok "param.set http_req_size 256"
 varnish v1 -cliok "param.set http_req_hdr_len 40"
 
 client c1 {
-	txreq -url "/1" -hdr "1...5: ..0....5....0....5....0....5....0"
+	txreq -url "/1" -hdr "host: 127.0.0.1" -hdr "1...5: ..0....5....0....5....0....5....0"
 	rxresp
 	expect resp.status == 200
-	txreq -url "/1" -hdr "1...5....0....5....0....5....0....5....0."
+	txreq -url "/1" -hdr "host: 127.0.0.1" -hdr "1...5....0....5....0....5....0....5....0."
 	rxresp
 	expect resp.status == 400
 } -run
 
 client c1 {
-	txreq -url "/2" -hdr "1...5: ..0....5\n ..0....5....0....5....0"
+	txreq -url "/2" -hdr "host: 127.0.0.1" -hdr "1...5: ..0....5\n ..0....5....0....5....0"
 	rxresp
 	expect resp.status == 200
-	txreq -url "/2" -hdr "1...5....0....5\n ..0....5....0....5....0."
+	txreq -url "/2" -hdr "host: 127.0.0.1" -hdr "1...5....0....5\n ..0....5....0....5....0."
 	rxresp
 	expect resp.status == 400
 } -run
diff --git a/bin/varnishtest/tests/c00084.vtc b/bin/varnishtest/tests/c00084.vtc
index 37b3be238..dff306944 100644
--- a/bin/varnishtest/tests/c00084.vtc
+++ b/bin/varnishtest/tests/c00084.vtc
@@ -6,7 +6,7 @@ varnish v1 \
 	-vcl {
 	import directors;
 
-	acl my-acl { "127.0.0.1"; }
+	acl my-acl { "${localhost}"; }
 
 	probe my-pb { }
 	backend my-be {
diff --git a/bin/varnishtest/tests/d00003.vtc b/bin/varnishtest/tests/d00003.vtc
index 238d5e52d..fc799c72b 100644
--- a/bin/varnishtest/tests/d00003.vtc
+++ b/bin/varnishtest/tests/d00003.vtc
@@ -51,31 +51,31 @@ varnish v1 -vcl+backend {
 } -start
 
 client c1 {
-	txreq -url /1
+	txreq -url /1 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "1"
 
-	txreq -url /3
+	txreq -url /3 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "2"
 
-	txreq -url /13
+	txreq -url /13 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "3"
 
-	txreq -url /8
+	txreq -url /8 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "4"
 
-	txreq -url "/emptystring"
+	txreq -url "/emptystring" -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "6"
 
-	txreq -url "/nohdr"
+	txreq -url "/nohdr" -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "8"
 
-	txreq -url "/ip"
+	txreq -url "/ip" -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "9"
 } -run
@@ -83,19 +83,19 @@ client c1 {
 server s2 -start
 
 client c1 {
-	txreq -req "DELETE"
+	txreq -req "DELETE" -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.status == 204
 
-	txreq
+	txreq -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "1"
 
-	txreq
+	txreq -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "4"
 
-	txreq
+	txreq -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.http.foo == "9"
 } -run
diff --git a/bin/varnishtest/tests/d00006.vtc b/bin/varnishtest/tests/d00006.vtc
index fc35395c1..f6f9a29d8 100644
--- a/bin/varnishtest/tests/d00006.vtc
+++ b/bin/varnishtest/tests/d00006.vtc
@@ -24,7 +24,7 @@ server s4 {
 
 varnish v1 -errvcl {Name of VCL object, 'rr1.xx', contains illegal character '.'} {
 	import directors;
-	backend b1 { .host = "127.0.0.1"; .port = "8080";}
+	backend b1 { .host = "${localhost}"; .port = "8080";}
 	sub vcl_init {
 		new rr1.xx = directors.round_robin();
 	}
diff --git a/bin/varnishtest/tests/h00001.vtc b/bin/varnishtest/tests/h00001.vtc
index f8b98a2ec..7f8c11599 100644
--- a/bin/varnishtest/tests/h00001.vtc
+++ b/bin/varnishtest/tests/h00001.vtc
@@ -17,7 +17,7 @@ haproxy h1 -conf {
 	timeout client          30s
 
     backend be1
-	server srv1 ${s1_addr}:${s1_port}
+	server srv1 ${s1_sock}
 
     frontend http1
 	use_backend be1
diff --git a/bin/varnishtest/tests/h00002.vtc b/bin/varnishtest/tests/h00002.vtc
index 935f2331a..c8c9bc1dd 100644
--- a/bin/varnishtest/tests/h00002.vtc
+++ b/bin/varnishtest/tests/h00002.vtc
@@ -17,7 +17,7 @@ haproxy h1 -D -conf {
 	timeout client          30s
 
     backend be1
-	server srv1 ${s1_addr}:${s1_port}
+	server srv1 ${s1_sock}
 
     frontend http1
 	use_backend be1
diff --git a/bin/varnishtest/tests/h00005.vtc b/bin/varnishtest/tests/h00005.vtc
index 098bf19ab..b6281040e 100644
--- a/bin/varnishtest/tests/h00005.vtc
+++ b/bin/varnishtest/tests/h00005.vtc
@@ -8,7 +8,7 @@ server s1 {
 	txresp
 } -start
 
-syslog S1 -level notice -bind "127.0.0.1:0" {
+syslog S1 -level notice -bind "${listen_addr}" {
 	recv
 	recv
 	recv info
@@ -17,7 +17,7 @@ syslog S1 -level notice -bind "127.0.0.1:0" {
 
 haproxy h1 -conf {
     global
-	log ${S1_addr}:${S1_port} local0
+	log ${S1_sock} local0
 
     defaults
 	log global
@@ -32,7 +32,7 @@ haproxy h1 -conf {
 	default_backend    be1
 
     backend be1
-	server srv1 ${s1_addr}:${s1_port}
+	server srv1 ${s1_sock}
 } -start
 
 client c1 -connect ${h1_fe_1_sock} {
@@ -42,4 +42,3 @@ client c1 -connect ${h1_fe_1_sock} {
 } -run
 
 syslog S1 -wait
-
diff --git a/bin/varnishtest/tests/h00006.vtc b/bin/varnishtest/tests/h00006.vtc
index 556cd6d05..18e099162 100644
--- a/bin/varnishtest/tests/h00006.vtc
+++ b/bin/varnishtest/tests/h00006.vtc
@@ -30,6 +30,7 @@ varnish v1 -arg "-a ${tmpdir}/v1.sock,PROXY" -vcl+backend {
 		"localhost";
 		"127.0.0.1";
 		"::1";
+		"${localhost}";
 		"${s1_addr}";		// Jails IPv4 address
 		"${h1_fe1_addr}";	// Jails IPv6 address
 	}
diff --git a/bin/varnishtest/tests/h00007.vtc b/bin/varnishtest/tests/h00007.vtc
index fa42fcb8f..b153590ba 100644
--- a/bin/varnishtest/tests/h00007.vtc
+++ b/bin/varnishtest/tests/h00007.vtc
@@ -22,7 +22,7 @@ haproxy h1 -D -conf {
 
     listen ssloff
 	bind "fd@${fe1}"
-	server v1 ${v1_addr}:${v1_port} send-proxy-v2
+	server v1 ${v1_sock} send-proxy-v2
 } -start
 
 varnish v1 -vcl+backend {
@@ -32,6 +32,7 @@ varnish v1 -vcl+backend {
 		"localhost";
 		"127.0.0.1";
 		"::1";
+		"${localhost}";
 		"${s1_addr}";		# Jail IPv4 address
 		"${h1_fe1_addr}";	# Jail IPv6 address
 	}
diff --git a/bin/varnishtest/tests/m00000.vtc b/bin/varnishtest/tests/m00000.vtc
index a64fa7d06..48fc749c0 100644
--- a/bin/varnishtest/tests/m00000.vtc
+++ b/bin/varnishtest/tests/m00000.vtc
@@ -173,7 +173,7 @@ varnish v1 -errvcl {Symbol not found: 'obj'} {
 varnish v1 -errvcl {Failed initialization} {
 	import debug;
 	import directors;
-	backend default { .host = "127.0.0.1"; }
+	backend default { .host = "${localhost}"; }
 	sub vcl_init {
 		return (fail);
 		# uninitialized objects coverage
diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc
index bb0568cd1..95ea39af0 100644
--- a/bin/varnishtest/tests/m00008.vtc
+++ b/bin/varnishtest/tests/m00008.vtc
@@ -3,7 +3,7 @@ varnishtest "VCL compiler vmod coverage / vmod loading"
 feature topbuild
 
 varnish v1 -errvcl {Symbol 'debug' has wrong type (sub):} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub debug {}
 	import debug;
 
diff --git a/bin/varnishtest/tests/m00017.vtc b/bin/varnishtest/tests/m00017.vtc
index 78a47e49f..78e3bdcbc 100644
--- a/bin/varnishtest/tests/m00017.vtc
+++ b/bin/varnishtest/tests/m00017.vtc
@@ -313,21 +313,21 @@ server s1 -repeat 3 -keepalive {
 } -start
 
 client c6 {
-	txreq -url /8
+	txreq -url /8 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.status == 200
 	expect resp.http.fetch == "Fetch value 1"
 	expect resp.http.response == "123"
 	expect resp.http.response2 == "Another response"
 
-	txreq -url /9
+	txreq -url /9 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.status == 200
 	expect resp.http.fetch == "Fetch value 1"
 	expect resp.http.response == "123"
 	expect resp.http.response2 == "Another response"
 
-	txreq -url /10
+	txreq -url /10 -hdr "Host: 127.0.0.1"
 	rxresp
 	expect resp.status == 200
 	expect resp.http.fetch == "Fetch value 1"
diff --git a/bin/varnishtest/tests/m00019.vtc b/bin/varnishtest/tests/m00019.vtc
index edc0e3ab7..bebbfe4d7 100644
--- a/bin/varnishtest/tests/m00019.vtc
+++ b/bin/varnishtest/tests/m00019.vtc
@@ -72,7 +72,7 @@ delay .1
 
 varnish v1 -errvcl {Argument 'one' already used} {
 	import debug;
-	backend b1 {.host = "127.0.0.1";}
+	backend b1 {.host = "${localhost}";}
 	sub vcl_deliver {
 		set resp.http.foo5 = debug.argtest("1", one="1");
 	}
@@ -80,7 +80,7 @@ varnish v1 -errvcl {Argument 'one' already used} {
 
 varnish v1 -errvcl {Argument 'one' missing} {
 	import debug;
-	backend b1 {.host = "127.0.0.1";}
+	backend b1 {.host = "${localhost}";}
 	sub vcl_deliver {
 		set resp.http.foo5 = debug.argtest(two=2.0, three="3");
 	}
@@ -88,7 +88,7 @@ varnish v1 -errvcl {Argument 'one' missing} {
 
 varnish v1 -errvcl {Unknown argument 'five'} {
 	import debug;
-	backend b1 {.host = "127.0.0.1";}
+	backend b1 {.host = "${localhost}";}
 	sub vcl_deliver {
 		set resp.http.foo5 = debug.argtest("1", two=2.0, five="3");
 	}
diff --git a/bin/varnishtest/tests/m00025.vtc b/bin/varnishtest/tests/m00025.vtc
index 432043f84..1ac8ea712 100644
--- a/bin/varnishtest/tests/m00025.vtc
+++ b/bin/varnishtest/tests/m00025.vtc
@@ -3,7 +3,7 @@ varnishtest "Pass probe definitions to VMODs"
 varnish v1 -vcl {
 	import debug;
 
-	backend be { .host = "127.0.0.1"; }
+	backend be { .host = "${localhost}"; }
 	probe pb { }
 
 	sub vcl_init {
diff --git a/bin/varnishtest/tests/r00310.vtc b/bin/varnishtest/tests/r00310.vtc
index c00e4c87e..6231149ba 100644
--- a/bin/varnishtest/tests/r00310.vtc
+++ b/bin/varnishtest/tests/r00310.vtc
@@ -1,7 +1,7 @@
 varnishtest "Test obj.http.x-cache in vcl_hit"
 
 varnish v1 -errvcl {Variable is read only.} {
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 
 	sub vcl_hit {
 		set obj.http.x-cache = "hit";
diff --git a/bin/varnishtest/tests/r00409.vtc b/bin/varnishtest/tests/r00409.vtc
index 80acd3461..1ef578932 100644
--- a/bin/varnishtest/tests/r00409.vtc
+++ b/bin/varnishtest/tests/r00409.vtc
@@ -1,7 +1,7 @@
 varnishtest "Regression test for ticket 409"
 
 varnish v1 -errvcl {Expected CSTR got '!'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if ( req.url ~ ! "\.(png|jpg|gif|js|css)$" ) {
 			return (pass);
diff --git a/bin/varnishtest/tests/r00916.vtc b/bin/varnishtest/tests/r00916.vtc
index 6c951fb7a..e73ef10cd 100644
--- a/bin/varnishtest/tests/r00916.vtc
+++ b/bin/varnishtest/tests/r00916.vtc
@@ -6,7 +6,7 @@ server s1 {
 } -start
 
 varnish v1 -errvcl {Symbol not found: 's-1'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub s1 {
 	}
 	sub vcl_backend_response {
diff --git a/bin/varnishtest/tests/r00921.vtc b/bin/varnishtest/tests/r00921.vtc
index 7eac5bbcf..9c0b556de 100644
--- a/bin/varnishtest/tests/r00921.vtc
+++ b/bin/varnishtest/tests/r00921.vtc
@@ -10,7 +10,7 @@ server s1 {
 varnish v1 -vcl+backend {
 	sub vcl_recv {
 		set req.http.bar = regsub(req.url, ".*", client.ip);
-		set req.http.foo = regsub(client.ip, ":.*", client.ip);
+		set req.http.foo = regsub(client.ip, "#.*", client.ip);
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r00948.vtc b/bin/varnishtest/tests/r00948.vtc
index d029990cb..e0d01f2e4 100644
--- a/bin/varnishtest/tests/r00948.vtc
+++ b/bin/varnishtest/tests/r00948.vtc
@@ -11,10 +11,10 @@ server s1 {
 varnish v1 -vcl+backend {
 
 sub vcl_recv {
-	if (client.ip == "${s1_addr}" || client.ip == "127.0.0.1") {
+	if (client.ip == "${s1_addr}" || client.ip == "${localhost}") {
 		set req.http.foo1 = "Match";
 	}
-	if (client.ip == "127.0.0.1" || client.ip == "${s1_addr}") {
+	if (client.ip == "${localhost}" || client.ip == "${s1_addr}") {
 		set req.http.foo2 = "Match";
 	}
 }
diff --git a/bin/varnishtest/tests/r01002.vtc b/bin/varnishtest/tests/r01002.vtc
index fbede7ce8..3d6e700dd 100644
--- a/bin/varnishtest/tests/r01002.vtc
+++ b/bin/varnishtest/tests/r01002.vtc
@@ -3,7 +3,7 @@ varnishtest "Real relational comparisons"
 varnish v1 -vcl {
 	import std;
 
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 	sub vcl_recv {
 		if (std.random(0,5) < 1.0) {
 			return (pipe);
diff --git a/bin/varnishtest/tests/r01144.vtc b/bin/varnishtest/tests/r01144.vtc
index 284c8489c..00a4312aa 100644
--- a/bin/varnishtest/tests/r01144.vtc
+++ b/bin/varnishtest/tests/r01144.vtc
@@ -8,7 +8,7 @@ server s1 {
 varnish v1 -vcl+backend {
 	backend fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
 	{
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.port = "54321";
 	}
 	sub vcl_backend_fetch {
@@ -27,7 +27,7 @@ client c1 {
 varnish v1 -errvcl {Expected ID got '0'} {
 	backend 0fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
 	{
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.port = "54321";
 	}
 	sub vcl_backend_fetch {
diff --git a/bin/varnishtest/tests/r01164.vtc b/bin/varnishtest/tests/r01164.vtc
index 295148232..7d5b1740a 100644
--- a/bin/varnishtest/tests/r01164.vtc
+++ b/bin/varnishtest/tests/r01164.vtc
@@ -2,7 +2,7 @@ varnishtest "Regression test for #1163: allow backends to be named storage*"
 
 varnish v1 -vcl {
 	backend storage_foo {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 	}
 
 	sub vcl_backend_fetch {
@@ -12,7 +12,7 @@ varnish v1 -vcl {
 
 varnish v1 -vcl {
 	backend storagefoo {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 	}
 
 	sub vcl_backend_fetch {
diff --git a/bin/varnishtest/tests/r01212.vtc b/bin/varnishtest/tests/r01212.vtc
index 236b459ab..d22c16a33 100644
--- a/bin/varnishtest/tests/r01212.vtc
+++ b/bin/varnishtest/tests/r01212.vtc
@@ -2,7 +2,7 @@ varnishtest "#1212 - Vmod with HEADER argument given a STRING asserts the VCL co
 
 varnish v1 -errvcl {Expression has type STRING, expected HEADER} {
 	import std;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		std.collect("foo");
 	}
diff --git a/bin/varnishtest/tests/r01312.vtc b/bin/varnishtest/tests/r01312.vtc
index 762da43bf..14674221f 100644
--- a/bin/varnishtest/tests/r01312.vtc
+++ b/bin/varnishtest/tests/r01312.vtc
@@ -17,8 +17,8 @@ varnish v1 -vcl+backend {
 		"127.0.1"/19;
 	}
 	sub vcl_deliver {
-		set resp.http.ACLfoo = std.ip("127.0.0.1", client.ip) ~ foo;
-		set resp.http.ACLbar = std.ip("127.0.0.1", client.ip) ~ bar;
+		set resp.http.ACLfoo = std.ip("${localhost}", client.ip) ~ foo;
+		set resp.http.ACLbar = std.ip("${localhost}", client.ip) ~ bar;
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r01498.vtc b/bin/varnishtest/tests/r01498.vtc
index 0c81af543..8b5cfad61 100644
--- a/bin/varnishtest/tests/r01498.vtc
+++ b/bin/varnishtest/tests/r01498.vtc
@@ -4,7 +4,7 @@ varnish v1 -vcl {
 	vcl 4.0;
 	import directors;
 	backend s1 {
-	     .host = "127.0.0.1";
+	     .host = "${localhost}";
 	     .port = "80";
 	}
 	sub vcl_init {
diff --git a/bin/varnishtest/tests/r01504.vtc b/bin/varnishtest/tests/r01504.vtc
index 9767ff0b4..da4d92c61 100644
--- a/bin/varnishtest/tests/r01504.vtc
+++ b/bin/varnishtest/tests/r01504.vtc
@@ -6,10 +6,10 @@ varnish v1 -arg "-p vcc_err_unref=off" -vcl {
 		.host = "${bad_backend}";
 	}
 	acl foo {
-		"127.0.0.1";
+		"${localhost}";
 	}
 	acl bar {
-		"127.0.0.1";
+		"${localhost}";
 	}
 	sub vcl_recv {
 		if (vtc.no_ip() ~ bar) {
diff --git a/bin/varnishtest/tests/r01510.vtc b/bin/varnishtest/tests/r01510.vtc
index 1092ff7e1..c521bd943 100644
--- a/bin/varnishtest/tests/r01510.vtc
+++ b/bin/varnishtest/tests/r01510.vtc
@@ -11,7 +11,7 @@ varnish v1 -errvcl {Instance 'first' redefined.} {
 varnish v1 -errvcl {Name 'first' already defined.} {
 	import debug;
 
-	backend first { .host = "127.0.0.1"; }
+	backend first { .host = "${localhost}"; }
 
 	sub vcl_init {
 		new first = debug.obj("FOO");
diff --git a/bin/varnishtest/tests/r01566.vtc b/bin/varnishtest/tests/r01566.vtc
index d78c8ac4e..a317feb15 100644
--- a/bin/varnishtest/tests/r01566.vtc
+++ b/bin/varnishtest/tests/r01566.vtc
@@ -1,7 +1,7 @@
 varnishtest "escape issue in regexp"
 
 varnish v1 -vcl {
-	backend b1 { .host = "127.0.0.1"; }
+	backend b1 { .host = "${localhost}"; }
 
 	sub vcl_recv {
 		set req.url = regsuball(req.url, "\??(p|pi)=.*?(&|$)", "");
diff --git a/bin/varnishtest/tests/r01569.vtc b/bin/varnishtest/tests/r01569.vtc
index aed91b184..94cf48f16 100644
--- a/bin/varnishtest/tests/r01569.vtc
+++ b/bin/varnishtest/tests/r01569.vtc
@@ -5,7 +5,7 @@ varnish v1 -errvcl {Name 'debug' already defined.} {
 	import debug;
 
 	backend debug {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.port = "80";
 	}
 
diff --git a/bin/varnishtest/tests/r01804.vtc b/bin/varnishtest/tests/r01804.vtc
index 7fcbaa1e6..252dd5845 100644
--- a/bin/varnishtest/tests/r01804.vtc
+++ b/bin/varnishtest/tests/r01804.vtc
@@ -6,7 +6,7 @@ server s1 {
 } -start
 
 
-varnish v1 -arg "-a foo=127.0.0.1:0,PROXY"
+varnish v1 -arg "-a foo=${listen_addr},PROXY"
 varnish v1 -arg "-p thread_pools=1"
 varnish v1 -vcl+backend "" -start
 
diff --git a/bin/varnishtest/tests/r01837.vtc b/bin/varnishtest/tests/r01837.vtc
index e96a44cf7..7a4034e75 100644
--- a/bin/varnishtest/tests/r01837.vtc
+++ b/bin/varnishtest/tests/r01837.vtc
@@ -2,7 +2,7 @@ varnishtest "Test VCC errors out if probe is used before it is defined"
 
 varnish v1 -errvcl "Symbol not found: 'p'" {
 	backend b {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = p;
 	}
 	probe p {
diff --git a/bin/varnishtest/tests/r01990.vtc b/bin/varnishtest/tests/r01990.vtc
index c6a83292c..56359dc09 100644
--- a/bin/varnishtest/tests/r01990.vtc
+++ b/bin/varnishtest/tests/r01990.vtc
@@ -9,7 +9,7 @@ varnish v1 -vcl {
 
 	sub vcl_backend_fetch {
 		# avoid LostHeader      b Host: %s
-		set bereq.http.Host = "127.0.0.1";
+		set bereq.http.Host = "${localhost}";
 		vtc.workspace_alloc(backend, vtc.workspace_free(backend));
 	}
 
diff --git a/bin/varnishtest/tests/r02157.vtc b/bin/varnishtest/tests/r02157.vtc
index 4aaba65ee..62ba0ac80 100644
--- a/bin/varnishtest/tests/r02157.vtc
+++ b/bin/varnishtest/tests/r02157.vtc
@@ -8,10 +8,10 @@ server s1 {
 varnish v1 -vcl+backend {} -start
 
 # 64 chars vlc name, 64 chars backend name
-varnish v1 -cliok { vcl.inline abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 "vcl 4.0; backend abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 {.host = \"127.0.0.1\"; .port = \"${s1_port}\";} " }
+varnish v1 -cliok { vcl.inline abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 "vcl 4.0; backend abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 {.host = \"${localhost}\"; .port = \"${s1_port}\";} " }
 
 # 127 chars vlc name, 1 char backend name
-varnish v1 -cliok { vcl.inline abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678 "vcl 4.0; backend a {.host = \"127.0.0.1\"; .port = \"${s1_port}\";} " }
+varnish v1 -cliok { vcl.inline abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678 "vcl 4.0; backend a {.host = \"${localhost}\"; .port = \"${s1_port}\";} " }
 
 client c1 {
 	txreq
diff --git a/bin/varnishtest/tests/r02839.vtc b/bin/varnishtest/tests/r02839.vtc
index 275d934ff..2b8aa4e38 100644
--- a/bin/varnishtest/tests/r02839.vtc
+++ b/bin/varnishtest/tests/r02839.vtc
@@ -10,7 +10,7 @@ varnish v1 -vcl+backend "" -start
 varnish v1 -errvcl "Object nullobj not initialized" {
 	import debug;
 
-	backend default { .host = "127.0.0.1"; }
+	backend default { .host = "${localhost}"; }
 
 	sub vcl_init {
 		if (false) {
@@ -22,7 +22,7 @@ varnish v1 -errvcl "Object nullobj not initialized" {
 varnish v1 -vcl {
 	import debug;
 
-	backend default { .host = "127.0.0.1"; }
+	backend default { .host = "${localhost}"; }
 
 	sub vcl_init {
 		if (false) {
diff --git a/bin/varnishtest/tests/r03360.vtc b/bin/varnishtest/tests/r03360.vtc
index 72668ff9b..9c1e81c10 100644
--- a/bin/varnishtest/tests/r03360.vtc
+++ b/bin/varnishtest/tests/r03360.vtc
@@ -5,11 +5,11 @@ shell {echo include '"_recurse2.vcl";' > ${tmpdir}/_recurse1.vcl}
 shell {echo include '"_recurse1.vcl";' > ${tmpdir}/_recurse2.vcl}
 
 varnish v1 -arg "-p vcl_path=${tmpdir}" -errvcl "Recursive include of" {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "_recurse.vcl" ;
 }
 
 varnish v2 -arg "-p vcl_path=${tmpdir}" -errvcl "Recursive include of" {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "_recurse1.vcl" ;
 }
diff --git a/bin/varnishtest/tests/u00000.vtc b/bin/varnishtest/tests/u00000.vtc
index 29e602253..dbed3ce58 100644
--- a/bin/varnishtest/tests/u00000.vtc
+++ b/bin/varnishtest/tests/u00000.vtc
@@ -1,15 +1,15 @@
 varnishtest "Code coverage of mgt_main, (VCL compiler and RSTdump etc)"
 
-shell "varnishd -b 127.0.0.1:80 -C 2> ${tmpdir}/_.c"
+shell "varnishd -b None -C 2> ${tmpdir}/_.c"
 
 shell {
-	varnishd -n ${tmpdir}/no_keep -C -b 127.0.0.1:80 2> no_keep.c
+	varnishd -n ${tmpdir}/no_keep -C -b None 2> no_keep.c
 	test -s no_keep.c && ! test -d no_keep || \
 	    (test -f no_keep/*/vgc.gcda || test -d no_keep/*/vgc.so.dSYM)
 }
 
 shell {
-	varnishd -n ${tmpdir}/keep -p debug=+vcl_keep -C -b 127.0.0.1:80 2> keep.c
+	varnishd -n ${tmpdir}/keep -p debug=+vcl_keep -C -b None 2> keep.c
 	test -s keep.c && test -d keep
 }
 
@@ -54,8 +54,8 @@ shell -expect {Copyright (c) 2006} "varnishd -V"
 
 shell -err -expect {Only one of -d or -F can be specified} "varnishd -d -F "
 shell -err -expect {Only one of -b or -f can be specified} "varnishd -b a -f b "
-shell -err -expect {-d makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -d "
-shell -err -expect {-F makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -F "
+shell -err -expect {-d makes no sense with -C} "varnishd -C -b None -d "
+shell -err -expect {-F makes no sense with -C} "varnishd -C -b None -F "
 shell -err -expect {Neither -b nor -f given} { varnishd -n ${tmpdir}/v0  }
 
 # Test -I and -l arguments (former a00016)
diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc
index 680b1fa7a..1191f085f 100644
--- a/bin/varnishtest/tests/u00003.vtc
+++ b/bin/varnishtest/tests/u00003.vtc
@@ -29,7 +29,7 @@ shell {
 		-w ${tmpdir}/ncsa.log -R 100/s
 }
 
-process p1 -winsz 25 132 {varnishncsa -n ${v1_name}} -start
+process p1 -winsz 25 200 {varnishncsa -n ${v1_name}} -start
 
 delay 1
 
@@ -125,11 +125,11 @@ ${localhost} -$} \
 # -f and standard formatters
 shell {echo "%b %D %H %h %I %{baz}i %l %m %{Age}o %O %q %s %t %{%Y}t \
 %T %U %u" > ${tmpdir}/format}
-shell -match {^100 \d+ HTTP/1.1 \d+.\d+.\d+.\d+ \d+ - - GET 0 \d+ (?#
+shell -match {^100 \d+ HTTP/1.1 (?:\d+.\d+.\d+.\d+|[a-f0-9:]+) \d+ - - GET 0 \d+ (?#
 )\?foo=bar 200 \[../.../(20[1-9][0-9]):..:..:.. [+-]....\] \1 \d+ /1 user
-\d+ \d+ HTTP/1.1 \d+.\d+.\d+.\d+ \d+ qux - GET - \d+ (?#
+\d+ \d+ HTTP/1.1 (?:\d+.\d+.\d+.\d+|[a-f0-9:]+) \d+ qux - GET - \d+ (?#
 )\?foo=bar 404 \[../.../(20[1-9][0-9]):..:..:.. [+-]....\] \1 \d+ /1 -
-- \d+ HTTP/1.1 \d+.\d+.\d+.\d+ \d+ - - GET - \d+ (?#
+- \d+ HTTP/1.1 (?:\d+.\d+.\d+.\d+|[a-f0-9:]+) \d+ - - GET - \d+ (?#
 ) - \[../.../(20[1-9][0-9]):..:..:.. [+-]....\] \1 \d+ /2 -$} \
 	{varnishncsa -n ${v1_name} -d -f ${tmpdir}/format}
 
diff --git a/bin/varnishtest/tests/v00005.vtc b/bin/varnishtest/tests/v00005.vtc
index cd70d39c8..4e28d5388 100644
--- a/bin/varnishtest/tests/v00005.vtc
+++ b/bin/varnishtest/tests/v00005.vtc
@@ -3,7 +3,7 @@ varnishtest "VCL: test backend probe syntax"
 # Check status definition
 varnish v1 -vcl {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.expected_response = 204;
 		}
@@ -13,7 +13,7 @@ varnish v1 -vcl {
 # Check url definition
 varnish v1 -vcl {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.url = "/";
 		}
@@ -23,7 +23,7 @@ varnish v1 -vcl {
 # Check request definition
 varnish v1 -vcl {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.request =
 			    "GET / HTTP/1.1"
@@ -35,7 +35,7 @@ varnish v1 -vcl {
 # Check redefinition
 varnish v1 -errvcl {Probe request redefinition at:} {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.url = "/";
 			.request =
@@ -48,7 +48,7 @@ varnish v1 -errvcl {Probe request redefinition at:} {
 # Check redefinition the other way
 varnish v1 -errvcl {Probe request redefinition at:} {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.request =
 			    "GET / HTTP/1.1"
@@ -60,7 +60,7 @@ varnish v1 -errvcl {Probe request redefinition at:} {
 
 varnish v1 -errvcl {Expected CNUM got '"120s"'} {
 	backend default {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.timeout = "120s";
 		}
diff --git a/bin/varnishtest/tests/v00016.vtc b/bin/varnishtest/tests/v00016.vtc
index 6f09d10fb..250bdd51c 100644
--- a/bin/varnishtest/tests/v00016.vtc
+++ b/bin/varnishtest/tests/v00016.vtc
@@ -5,19 +5,19 @@ feature dns
 shell "true > ${tmpdir}/_varnishtest_empty_file"
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "${tmpdir}/_varnishtest_empty_file" ;
 }
 
 varnish v1 -errvcl {include <string> not followed by semicolon.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "${tmpdir}/_varnishtest_empty_file" |
 }
 
 shell "rm -f ${tmpdir}/_varnishtest_empty_file"
 
 varnish v1 -errvcl {include not followed by string constant.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include <<
 }
 
@@ -31,18 +31,18 @@ varnish v1 -errvcl {include not followed by string constant.} {
 }
 
 varnish v1 -errvcl {Unknown duration unit 'k'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.ttl = 1. k; }
 }
 
 varnish v1 -errvcl {Operator > not possible on BACKEND} {
-	backend a { .host = "127.0.0.1"; }
-	backend b { .host = "127.0.0.1"; }
+	backend a { .host = "${localhost}"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { if (a > b) { } }
 }
 
 varnish v1 -errvcl {Unknown property 'foo' for type HTTP} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_hash { if (req.foo != "bar") { } }
 }
 
@@ -53,21 +53,21 @@ varnish v1 -errvcl {Symbol not found: 'foo.bar'} {
 }
 
 varnish v1 -errvcl {Cannot be set in subroutine 'vcl_pipe'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_pipe {
 		set bereq.first_byte_timeout = 10s;
 	}
 }
 
 varnish v1 -errvcl {Cannot be set in subroutine 'vcl_pipe'.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_pipe {
 		set bereq.between_bytes_timeout = 10s;
 	}
 }
 
 varnish v1 -errvcl {Symbol not found: 'c'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response {
 		if (beresp.backend == c) {
 			set beresp.ttl = 1h;
@@ -76,14 +76,14 @@ varnish v1 -errvcl {Symbol not found: 'c'} {
 }
 
 varnish v1 -errvcl {Regexp compilation error:} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if (req.url ~ "[a") {}
 	}
 }
 
 varnish v1 -errvcl {resolves to too many addresses} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if (remote.ip == "dns-canary-multi.varnish-cache.org") {}
 	}
@@ -91,7 +91,7 @@ varnish v1 -errvcl {resolves to too many addresses} {
 
 varnish v1 -errvcl {Symbol 'foo' has wrong type (instance):} {
 	import directors;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub vcl_init {
 		new foo = directors.shard();
@@ -105,7 +105,7 @@ varnish v1 -errvcl {Symbol 'foo' has wrong type (instance):} {
 
 varnish v1 -syntax 4.0 -errvcl {Undefined acl foo} {
 	import directors;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub vcl_init {
 		new foo = directors.shard();
@@ -130,7 +130,7 @@ varnish v1 -errvcl {Undefined sub foo} {
 varnish v1 -syntax 4.0 -errvcl {Symbol not found: 'directors.foo'
 At:} {
 	import directors;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub vcl_init {
 		new foo = directors.foo();
@@ -139,10 +139,10 @@ At:} {
 
 # 'foo' overloaded
 varnish v1 -syntax 4.0 -errvcl {Symbol not found: 'foo'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	acl foo {
-	    "127.0.0.1"/32;
+	    "${localhost}"/32;
 	}
 	sub vcl_init {
 		new bar = foo;
diff --git a/bin/varnishtest/tests/v00017.vtc b/bin/varnishtest/tests/v00017.vtc
index 2809b2fe1..6e35d0c23 100644
--- a/bin/varnishtest/tests/v00017.vtc
+++ b/bin/varnishtest/tests/v00017.vtc
@@ -1,19 +1,19 @@
 varnishtest "VCL compiler coverage test: vcc_acl.c"
 
 varnish v1 -errvcl {Too wide mask (/33) for IPv4 address} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { "10.1.2.3"/33; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -errvcl {Too wide mask (/129) for IPv6 address} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { "1::2"/129; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		"1.2.3.4"/31;
 		"1.2.3.4"/31;
@@ -22,7 +22,7 @@ varnish v1 -vcl {
 }
 
 varnish v1 -errvcl {Conflicting ACL entries:} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		"1.2.3.4";
 		!"1.2.3.4";
@@ -31,31 +31,31 @@ varnish v1 -errvcl {Conflicting ACL entries:} {
 }
 
 varnish v1 -errvcl {DNS lookup(...com): } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { "...com"; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -errvcl {DNS lookup(10.1..2): } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { "10.1..2"; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -errvcl {Expected ')' got ';'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { ( "10.1.2"; }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -errvcl {Expected ';' got ')'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a { "10.1.2" ); }
 	sub vcl_recv { if (client.ip ~ a) { return(pass); } }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		! "10.1.3";
 		("...com" / 22);
@@ -65,12 +65,12 @@ varnish v1 -vcl {
 }
 
 varnish v1 -errvcl {Operator > not possible on IP} {
-	backend b { .host = "127.0.0.1"; }
-	sub vcl_recv { if (client.ip > "127.0.0.1") { return(pass); } }
+	backend b { .host = "${localhost}"; }
+	sub vcl_recv { if (client.ip > "${localhost}") { return(pass); } }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		"10.1.1"/25;
 		"10.1.3"/26;
@@ -86,7 +86,7 @@ varnish v1 -vcl {
 }
 
 varnish v1 -errvcl {.../mask is not numeric.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		"10.0.1.0/1bc";
 	}
@@ -94,7 +94,7 @@ varnish v1 -errvcl {.../mask is not numeric.} {
 }
 
 varnish v1 -errvcl {/mask only allowed once} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	acl a {
 		"10.0.1.0/22" / 22;
 	}
diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index d2728bcaf..56116f9ab 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -1,121 +1,121 @@
 varnishtest "VCL compiler coverage test: vcc_action.c"
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_miss { return(synth(100,req.url)); }
 	sub vcl_hit { return(synth(100,"the butter please")); }
 	sub vcl_deliver { return(synth(resp.status, resp.reason)); }
 }
 
 varnish v1 -errvcl {Variable is read only.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_miss { set now = 1000; }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.ttl /= 2; }
 }
 
 varnish v1 -errvcl {Expected '=' got '>>'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.ttl >>= 2; }
 }
 
 varnish v1 -errvcl {Expected '=' got '+='} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_fetch { set bereq.backend += b; }
 }
 
 varnish v1 -errvcl {Expected ';' got 'if'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	/* XXX: This should not really be an synth */
 	sub vcl_recv { set req.url = "foo" if "bar"; }
 }
 
 varnish v1 -errvcl {Unknown property 'foo' for type HTTP} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_hash { hash_data(req.foo); }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { set req.url = 1; }
 }
 
 varnish v1 -errvcl {Expected '=' got '+='} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.do_gzip += 1; }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.do_gzip = true; }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.do_gzip = false; }
 }
 
 varnish v1 -errvcl {Symbol not found: 'mu'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { set beresp.do_gzip = mu; }
 }
 
 varnish v1 -errvcl {Variable cannot be unset} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_response { unset beresp.do_gzip; }
 }
 
 varnish v1 -errvcl {Variable cannot be set.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_backend_fetch { set bereq.body = "foo"; }
 }
 
 varnish v1 -errvcl {Unknown token '<<' when looking for STRING} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { ban (<<); }
 }
 
 varnish v1 -errvcl {Symbol not found} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { ban_hash (if); }
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { ban ("req.url ~ foo"); }
 }
 
 varnish v1 -errvcl "Symbol not found" {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { kluf ; }
 }
 
 varnish v1 -errvcl {Unknown token '<<' when looking for STRING} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_synth { synthetic( << "foo"; }
 }
 
 varnish v1 -errvcl {Missing argument.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { return(synth); }
 }
 
 varnish v1 -errvcl {Arguments not allowed.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { return(pipe(XXX); }
 }
 
 varnish v1 -errvcl {Expected return action name.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { return(foobar); }
 }
 
 # issue #936
 varnish v1 -errvcl {Not a valid action in subroutine 'vcl_recv'} {
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 	sub vcl_recv {
 		synthetic("XXX");
 		return (synth(503));
diff --git a/bin/varnishtest/tests/v00019.vtc b/bin/varnishtest/tests/v00019.vtc
index 904586790..0d3bd6960 100644
--- a/bin/varnishtest/tests/v00019.vtc
+++ b/bin/varnishtest/tests/v00019.vtc
@@ -3,43 +3,43 @@ varnishtest "VCL compiler coverage test: vcc_token.c"
 varnish v1 -errvcl {Unterminated inline C source, starting at} " C{ "
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	# comment
 	sub vcl_recv { set req.url = "x"; }
 }
 
 varnish v1 -errvcl {Unterminated /* ... */ comment, starting at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	/*
 }
 
 varnish v1 -errvcl {Unterminated long-string, starting at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	{" }
 }
 
 varnish v1 -errvcl {Unterminated long-string, starting at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	""" ""
 }
 
 varnish v1 -errvcl {Unterminated string, starting at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	"
 }
 
 varnish v1 -cliok "param.set vcc_allow_inline_c true" -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { C{ int i; (void)i; }C }
 }
 
 varnish v1 -errvcl {Syntax error at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	?
 }
 
 varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if ("foo" + "bar" == 777) {
 			set req.http.host = 1;
@@ -48,7 +48,7 @@ varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 }
 
 varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if ("foo" + "bar" ==
 		    777) {
@@ -58,7 +58,7 @@ varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 }
 
 varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		if ("foo" + "bar" ==
 
@@ -70,7 +70,7 @@ varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
 }
 
 varnish v1 -errvcl {Symbol not found: 'req.http.req.http.foo'} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		set req.http.req.http.foo = "bar";
 	}
diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc
index 4c2a526ae..45f9474cd 100644
--- a/bin/varnishtest/tests/v00020.vtc
+++ b/bin/varnishtest/tests/v00020.vtc
@@ -1,7 +1,7 @@
 varnishtest "VCL compiler coverage test: vcc_parse.c & vcc_expr.c"
 
 varnish v1 -cliok "param.set vcc_allow_inline_c true" -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	C{
 	#include <stdio.h>
 	}C
@@ -57,7 +57,7 @@ varnish v1 -errvcl {BOOL + BOOL not possible.} {
 }
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		set req.http.foo = "foo" + "bar";
 		set req.http.foo = "foo" + 1;
@@ -225,7 +225,7 @@ varnish v1 -errvcl {Function returns VOID} {
 
 varnish v1 -errvcl {Not available in subroutine 'vcl_recv'.} {
 	import blob;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		blob.encode(HEX, LOWER, req.hash);
 	}
@@ -233,14 +233,14 @@ varnish v1 -errvcl {Not available in subroutine 'vcl_recv'.} {
 
 varnish v1 -errvcl {Not available in subroutine 'vcl_hash'.} {
 	import blob;
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_hash {
 		blob.encode(HEX, LOWER, req.hash);
 	}
 }
 
 varnish v1 -errvcl {Not available in subroutine 'vcl_recv'.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv {
 		set req.http.foo = 100 + beresp.status;
 	}
@@ -264,7 +264,7 @@ Not available from subroutine 'vcl_recv'.
         sub vcl_recv { call foo; }
 ----------------------------###---
 } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub foo { set req.http.foo = 100 + beresp.status; }
 	sub vcl_recv { call foo; }
 }
@@ -293,7 +293,7 @@ Not available from subroutine 'vcl_recv'.
         sub vcl_recv { call bar; }
 ----------------------------###---
 } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub foo { set req.http.foo = 100 + beresp.status; }
 	sub bar { call foo; }
 	sub vcl_recv { call bar; }
diff --git a/bin/varnishtest/tests/v00021.vtc b/bin/varnishtest/tests/v00021.vtc
index ab0618f98..4c8e8ee26 100644
--- a/bin/varnishtest/tests/v00021.vtc
+++ b/bin/varnishtest/tests/v00021.vtc
@@ -1,37 +1,37 @@
 varnishtest "VCL compiler coverage test: vcc_xref.c vcc_var.c vcc_symb.c"
 
 varnish v1 -errvcl {Variable is read only.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_deliver { set obj.ttl = 1 w; }
 }
 
 varnish v1 -errvcl {Variable is read only.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub foo { set obj.ttl = 1 w; }
 	sub vcl_deliver { call foo; }
 }
 
 varnish v1 -errvcl {Not available in subroutine 'vcl_recv'.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	sub vcl_recv { set obj.ttl = 1 w; }
 }
 
 varnish v1 -errvcl {Not available from subroutine 'vcl_recv'.} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub foo { set obj.ttl = 1 w; }
 	sub vcl_recv { call foo; }
 }
 
 varnish v1 -errvcl "Symbol not found" {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub vcl_recv { discard; }
 }
 
 varnish v1 -errvcl "Symbol not found" {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub foo { discard; }
 	sub vcl_recv { call foo; }
@@ -55,7 +55,7 @@ Subroutine recurses on
         sub vcl_recv { call foo; }
 ----------------------------###---
 } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub foo { call foo; }
 	sub vcl_recv { call foo; }
@@ -85,7 +85,7 @@ Subroutine recurses on
         sub vcl_recv { call foo; }
 ----------------------------###---
 } {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub bar { call foo; }
 	sub foo { call bar; }
@@ -93,14 +93,14 @@ Subroutine recurses on
 }
 
 varnish v1 -errvcl {Unused acl foo, defined:} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
-	acl foo { "127.0.0.1"; }
+	acl foo { "${localhost}"; }
 
 }
 
 varnish v1 -errvcl {Unused sub foo, defined:} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub foo {
 	}
@@ -108,14 +108,14 @@ varnish v1 -errvcl {Unused sub foo, defined:} {
 
 # deliberately testing for name "none"
 varnish v1 -errvcl {Unused sub none, defined:} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub none {
 	}
 }
 
 varnish v1 -errvcl {Invalid return "deliver"} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 
 	sub vcl_recv {
 		call foo;
@@ -128,7 +128,7 @@ varnish v1 -errvcl {Invalid return "deliver"} {
 
 varnish v1 -errvcl {HTTP header (buckinghambuckingham..) is too long.} {
 
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 
 	sub vcl_deliver {
 		set resp.http.buckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambucking = "foobar";
@@ -137,7 +137,7 @@ varnish v1 -errvcl {HTTP header (buckinghambuckingham..) is too long.} {
 
 varnish v1 -vcl {
 
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 
 	sub vcl_deliver {
 		set resp.http.buckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckinghambuckin = "foobar";
@@ -145,7 +145,7 @@ varnish v1 -vcl {
 }
 
 varnish v1 -errvcl {Symbol not found: 'req.foobar'} {
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 	sub vcl_recv { set req.foobar = 3; }
 }
 
diff --git a/bin/varnishtest/tests/v00031.vtc b/bin/varnishtest/tests/v00031.vtc
index 70ca757af..902d4fa51 100644
--- a/bin/varnishtest/tests/v00031.vtc
+++ b/bin/varnishtest/tests/v00031.vtc
@@ -1,20 +1,20 @@
 varnishtest "param vcc_err_unref"
 
 varnish v1 -errvcl {Unused backend c, defined:} {
-	backend b { .host = "127.0.0.1"; }
-	backend c { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
+	backend c { .host = "${localhost}"; }
 }
 
 varnish v1 -cliok "param.set vcc_err_unref false"
 
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
-	backend c { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
+	backend c { .host = "${localhost}"; }
 }
 
 varnish v1 -cliok "param.set vcc_err_unref true"
 
 varnish v1 -errvcl {Unused backend c, defined:} {
-	backend b { .host = "127.0.0.1"; }
-	backend c { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
+	backend c { .host = "${localhost}"; }
 }
diff --git a/bin/varnishtest/tests/v00034.vtc b/bin/varnishtest/tests/v00034.vtc
index 768ef69ce..6bfe5fb08 100644
--- a/bin/varnishtest/tests/v00034.vtc
+++ b/bin/varnishtest/tests/v00034.vtc
@@ -8,25 +8,25 @@ server s1 {
 varnish v1 -vcl+backend { } -start
 
 varnish v1 -errvcl {Subroutine 'c1' redefined} {
-	backend foo { .host = "127.0.0.1"; }
+	backend foo { .host = "${localhost}"; }
 	sub c1 { }
 	sub c1 { }
 	sub vcl_recv { call c1; }
 }
 
 varnish v1 -errvcl {Backend 's1' redefined} {
-	backend s1 { .host = "127.0.0.1"; }
-	backend s1 { .host = "127.0.0.1"; }
+	backend s1 { .host = "${localhost}"; }
+	backend s1 { .host = "${localhost}"; }
 }
 
 varnish v1 -errvcl {Probe 'p1' redefined} {
 	probe p1 { }
 	probe p1 { }
-	backend s1 { .host = "127.0.0.1"; .probe = p1;}
+	backend s1 { .host = "${localhost}"; .probe = p1;}
 }
 
 varnish v1 -errvcl {Expected '(' got ';'} {
-	backend s1 { .host = "127.0.0.1"; }
+	backend s1 { .host = "${localhost}"; }
 	sub vcl_recv { return; }
 }
 
diff --git a/bin/varnishtest/tests/v00038.vtc b/bin/varnishtest/tests/v00038.vtc
index 6662eefb5..eca463012 100644
--- a/bin/varnishtest/tests/v00038.vtc
+++ b/bin/varnishtest/tests/v00038.vtc
@@ -14,7 +14,7 @@ varnish v1 -errvcl "IPv6 address has wrong port separator" {
 
 varnish v1 -errvcl "with exactly three digits" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.expected_response = 1000;
 		}
@@ -23,7 +23,7 @@ varnish v1 -errvcl "with exactly three digits" {
 
 varnish v1 -errvcl "Must specify .threshold with .window" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.window = 32;
 		}
@@ -32,7 +32,7 @@ varnish v1 -errvcl "Must specify .threshold with .window" {
 
 varnish v1 -errvcl "Threshold must be 64 or less" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.threshold = 65;
 		}
@@ -41,7 +41,7 @@ varnish v1 -errvcl "Threshold must be 64 or less" {
 
 varnish v1 -errvcl "Window must be 64 or less" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.window = 65;
 			.threshold = 64;
@@ -51,7 +51,7 @@ varnish v1 -errvcl "Window must be 64 or less" {
 
 varnish v1 -errvcl "Threshold can not be greater than window" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = {
 			.window = 63;
 			.threshold = 64;
@@ -61,20 +61,20 @@ varnish v1 -errvcl "Threshold can not be greater than window" {
 
 varnish v1 -errvcl "NB: Backend Syntax has changed:" {
 	backend b1 {
-		set .host = "127.0.0.1";
+		set .host = "${localhost}";
 	}
 }
 
 varnish v1 -errvcl "Expected '{' or name of probe, got" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.probe = "NONE";
 	}
 }
 
 varnish v1 -errvcl "Field 'port' redefined at:" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.port = "NONE";
 		.port = "NONE";
 	}
@@ -82,7 +82,7 @@ varnish v1 -errvcl "Field 'port' redefined at:" {
 
 varnish v1 -errvcl "Unknown field:" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.fourscoreandsevenyearsago = "NONE";
 	}
 }
@@ -100,19 +100,19 @@ varnish v1 -errvcl "No default probe defined" {
 }
 
 varnish v1 -errvcl "Only one default director possible." {
-	backend b1 { .host = "127.0.0.1"; }
-	backend default { .host = "127.0.0.1"; }
-	backend default { .host = "127.0.0.1"; }
+	backend b1 { .host = "${localhost}"; }
+	backend default { .host = "${localhost}"; }
+	backend default { .host = "${localhost}"; }
 }
 
 varnish v1 -errvcl "Unused backend b1, defined:" {
-	backend b1 { .host = "127.0.0.1"; }
-	backend default { .host = "127.0.0.1"; }
+	backend b1 { .host = "${localhost}"; }
+	backend default { .host = "${localhost}"; }
 }
 
 varnish v1 -errvcl "Address redefinition at:" {
 	backend b1 {
-		.host = "127.0.0.1";
+		.host = "${localhost}";
 		.path = "/path/to/uds";
 	}
 }
diff --git a/bin/varnishtest/tests/v00046.vtc b/bin/varnishtest/tests/v00046.vtc
index 2bbe9d4f1..458266211 100644
--- a/bin/varnishtest/tests/v00046.vtc
+++ b/bin/varnishtest/tests/v00046.vtc
@@ -3,13 +3,13 @@ varnishtest "Test relative to vcl_path, dot-include and absolute includes"
 # relative plain
 shell "true > ${tmpdir}/_start.vcl"
 varnish v1 -arg "-p vcl_path=${tmpdir}" -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "_start.vcl" ;
 }
 
 # absolute include
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "${tmpdir}/_start.vcl" ;
 }
 
@@ -18,20 +18,20 @@ shell "mkdir -p ${tmpdir}/1/2/3"
 shell "true  > ${tmpdir}/1/2/b.vcl"
 shell "echo 'include \"./2/b.vcl\";' > ${tmpdir}/1/a.vcl"
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "${tmpdir}/1/a.vcl" ;
 }
 
 # same but relative to vcl_path
 shell "echo 'include \"1/2/b.vcl\";' > ${tmpdir}/1/ab.vcl"
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/ab.vcl" ;
 }
 
 # dot-relative -> relative
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/a.vcl" ;
 }
 
@@ -39,28 +39,28 @@ varnish v1 -vcl {
 shell "echo 'include \"./3/c.vcl\";' > ${tmpdir}/1/2/b.vcl"
 shell "true  > ${tmpdir}/1/2/3/c.vcl"
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/a.vcl" ;
 }
 
 # relative -> absolute
 shell "echo 'include \"${tmpdir}/1/2/3/c.vcl\";' > ${tmpdir}/1/aa.vcl"
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/aa.vcl" ;
 }
 
 # relative -> absolute -> relative
 shell "echo 'include \"${tmpdir}/1/2/b.vcl\";' > ${tmpdir}/1/aaa.vcl"
 varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/aaa.vcl" ;
 }
 
 # includes and parses out
 shell "echo 'zool' > ${tmpdir}/1/2/3/c.vcl"
 varnish v1 -errvcl {Found: 'zool' at} {
-	backend b { .host = "127.0.0.1"; }
+	backend b { .host = "${localhost}"; }
 	include "1/a.vcl";
 }
 
diff --git a/bin/varnishtest/tests/v00049.vtc b/bin/varnishtest/tests/v00049.vtc
index 53e2cb705..e90d4173c 100644
--- a/bin/varnishtest/tests/v00049.vtc
+++ b/bin/varnishtest/tests/v00049.vtc
@@ -1,19 +1,19 @@
 varnishtest "VCL syntax numbers"
 
-varnish v1 -vcl {backend b1 { .host = "127.0.0.1:8080"; }} -start
+varnish v1 -vcl {backend b1 None;} -start
 
 varnish v1 -syntax 3.9 -errvcl "VCL version 3.9 not supported." {
-	backend b1 { .host = "127.0.0.1:8080"; }
+	backend b1 None;
 }
 
 varnish v1 -syntax 4.0 -errvcl "silly buggers" {
 	vcl 4.01;
-	backend b1 { .host = "127.0.0.1:8080"; }
+	backend b1 None;
 }
 
 varnish v1 -syntax 4.0 -errvcl "VCL version 9.9 not supported" {
 	vcl 9.9;
-	backend b1 { .host = "127.0.0.1:8080"; }
+	backend b1 None;
 }
 
 varnish v1 -cliexpect {Don't play silly buggers with VCL version numbers} \
@@ -24,4 +24,3 @@ varnish v1 -cliexpect {Don't play silly buggers with VCL version numbers} \
 
 varnish v1 -cliexpect {Expected 'vcl N.N;' found no semi-colon} \
 	{vcl.inline t2 "vcl 4.0  backend b { .host = \"localhost\";} "}
-


More information about the varnish-commit mailing list