[6.0] 074d66ad4 Tighten up tests

Federico G. Schwindt fgsch at lodoss.net
Thu Aug 16 08:52:27 UTC 2018


commit 074d66ad49f7fa3b8fda6a23e9d1ad734842be5a
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Wed Mar 28 17:09:55 2018 -0300

    Tighten up tests
    
    Prep work for upcoming change.

diff --git a/bin/varnishtest/tests/b00012.vtc b/bin/varnishtest/tests/b00012.vtc
index 224bd1ad6..6f81802ea 100644
--- a/bin/varnishtest/tests/b00012.vtc
+++ b/bin/varnishtest/tests/b00012.vtc
@@ -12,7 +12,7 @@ server s1 {
 varnish v1 -vcl+backend {} -start
 
 client c1 {
-	send "GET /foo HTTP/1.1\n\nGET /bar HTTP/1.1\n\nGET /bar HTTP/1.1\n\n"
+	send "GET /foo HTTP/1.1\nHost: foo\n\nGET /bar HTTP/1.1\nHost: foo\n\nGET /bar HTTP/1.1\nHost: foo\n\n"
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 3
diff --git a/bin/varnishtest/tests/b00013.vtc b/bin/varnishtest/tests/b00013.vtc
index ffae946df..46f564145 100644
--- a/bin/varnishtest/tests/b00013.vtc
+++ b/bin/varnishtest/tests/b00013.vtc
@@ -16,17 +16,17 @@ varnish v1 -cli "param.set accept_filter false"
 varnish v1 -start
 
 client c1 {
-	send "GET /foo HTTP/1.1\r\n\r\nGET "
+	send "GET /foo HTTP/1.1\r\nHost: foo\r\n\r\nGET "
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 3
 	expect resp.http.x-varnish == "1001"
-	send "/bar HTTP/1.1\n\nGET /bar "
+	send "/bar HTTP/1.1\nHost: foo\n\nGET /bar "
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 6
 	expect resp.http.x-varnish == "1003"
-	send "HTTP/1.1\n\n"
+	send "HTTP/1.1\nHost: foo\n\n"
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 6
diff --git a/bin/varnishtest/tests/b00040.vtc b/bin/varnishtest/tests/b00040.vtc
index 228aaa993..8d5db1525 100644
--- a/bin/varnishtest/tests/b00040.vtc
+++ b/bin/varnishtest/tests/b00040.vtc
@@ -46,28 +46,28 @@ delay .1
 
 client c1 {
 	send "GET /4 HTTP/1.1\r\n"
-	send "\r\n"
+	send "Host: foo\r\n\r\n"
 	rxresp
 	expect resp.status == 200
 } -run
 delay .1
 
 client c1 {
-	send "GET /5 HTTP/1.1\r\nHost: localhost\r\nBogo: Header\001More\r\n\r\n"
+	send "GET /5 HTTP/1.1\r\nHost: foo\r\nBogo: Header\001More\r\n\r\n"
 	rxresp
 	expect resp.status == 400
 } -run
 delay .1
 
 client c1 {
-	send "GET /6 HTTP/1.1\r\nHost: localhost\r\nBogo: Header\r\r\n\r\n"
+	send "GET /6 HTTP/1.1\r\nHost: foo\r\nBogo: Header\r\r\n\r\n"
 	rxresp
 	expect resp.status == 400
 } -run
 delay .1
 
 client c1 {
-	send "GET /7 HTTP/1.1\r\nHost: localhost\r\nBogo: Header\rMore\r\n\r\n"
+	send "GET /7 HTTP/1.1\r\nHost: foo\r\nBogo: Header\rMore\r\n\r\n"
 	rxresp
 	expect resp.status == 400
 } -run
diff --git a/bin/varnishtest/tests/b00055.vtc b/bin/varnishtest/tests/b00055.vtc
index bb3a36df6..076eb1b06 100644
--- a/bin/varnishtest/tests/b00055.vtc
+++ b/bin/varnishtest/tests/b00055.vtc
@@ -12,7 +12,7 @@ server s1 {
 varnish v1 -arg "-a ${tmpdir}/v1.sock" -vcl+backend {} -start
 
 client c1 -connect "${tmpdir}/v1.sock" {
-	send "GET /foo HTTP/1.1\n\nGET /bar HTTP/1.1\n\nGET /bar HTTP/1.1\n\n"
+	send "GET /foo HTTP/1.1\nHost: foo\n\nGET /bar HTTP/1.1\nHost: foo\n\nGET /bar HTTP/1.1\nHost: foo\n\n"
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 3
diff --git a/bin/varnishtest/tests/b00056.vtc b/bin/varnishtest/tests/b00056.vtc
index b875f0b77..4da3c7c67 100644
--- a/bin/varnishtest/tests/b00056.vtc
+++ b/bin/varnishtest/tests/b00056.vtc
@@ -16,17 +16,17 @@ varnish v1 -cli "param.set accept_filter false"
 varnish v1 -start
 
 client c1 -connect "${tmpdir}/v1.sock" {
-	send "GET /foo HTTP/1.1\r\n\r\nGET "
+	send "GET /foo HTTP/1.1\r\nHost: foo\r\n\r\nGET "
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 3
 	expect resp.http.x-varnish == "1001"
-	send "/bar HTTP/1.1\n\nGET /bar "
+	send "/bar HTTP/1.1\nHost: foo\n\nGET /bar "
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 6
 	expect resp.http.x-varnish == "1003"
-	send "HTTP/1.1\n\n"
+	send "HTTP/1.1\nHost: foo\n\n"
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 6
diff --git a/bin/varnishtest/tests/c00018.vtc b/bin/varnishtest/tests/c00018.vtc
index 96368b931..7a27755ff 100644
--- a/bin/varnishtest/tests/c00018.vtc
+++ b/bin/varnishtest/tests/c00018.vtc
@@ -55,9 +55,8 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1003	ReqMethod       {^POST$}
 	expect 0 1003	ReqURL          {^/$}
 	expect 0 1003	ReqProtocol     {^HTTP/1.1$}
-	expect 0 1003	ReqHeader       {^Content-Length: 20$}
-	expect 0 1003	ReqHeader       {^X-Forwarded-For:}
-	expect 0 1003	VCL_call        {^RECV$}
+	expect * 1003	ReqHeader       {^Content-Length: 20$}
+	expect * 1003	VCL_call        {^RECV$}
 	expect 0 1003	VCL_return      {^pass$}
 	expect 0 1003	RespProtocol    {^HTTP/1.1$}
 	expect 0 1003	RespStatus      {^100$}
@@ -70,9 +69,8 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1005	ReqMethod       {^POST$}
 	expect 0 1005	ReqURL          {^/$}
 	expect 0 1005	ReqProtocol     {^HTTP/1.1$}
-	expect 0 1005	ReqHeader       {^Content-Length: 3$}
-	expect 0 1005	ReqHeader       {^X-Forwarded-For:}
-	expect 0 1005	VCL_call        {^RECV$}
+	expect * 1005	ReqHeader       {^Content-Length: 3$}
+	expect * 1005	VCL_call        {^RECV$}
 	expect 0 1005	VCL_return      {^pass$}
 	expect 0 1005	VCL_call        {^HASH$}
 
@@ -82,9 +80,8 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1007	ReqMethod       {^POST$}
 	expect 0 1007	ReqURL          {^/late$}
 	expect 0 1007	ReqProtocol     {^HTTP/1.1$}
-	expect 0 1007	ReqHeader       {^Content-Length: 20$}
-	expect 0 1007	ReqHeader       {^X-Forwarded-For:}
-	expect 0 1007	VCL_call        {^RECV$}
+	expect * 1007	ReqHeader       {^Content-Length: 20$}
+	expect * 1007	VCL_call        {^RECV$}
 	expect 0 1007	VCL_return      {^pass$}
 	expect 0 1007	VCL_call        {^HASH$}
 	expect 0 1007	VCL_return      {^lookup$}
@@ -104,9 +101,8 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1009	ReqMethod       {^POST$}
 	expect 0 1009	ReqURL          {^/latecache$}
 	expect 0 1009	ReqProtocol     {^HTTP/1.1$}
-	expect 0 1009	ReqHeader       {^Content-Length: 20$}
-	expect 0 1009	ReqHeader       {^X-Forwarded-For:}
-	expect 0 1009	VCL_call        {^RECV$}
+	expect * 1009	ReqHeader       {^Content-Length: 20$}
+	expect * 1009	VCL_call        {^RECV$}
 	expect 0 1009	Storage         {^(malloc|umem) Transient$}
 	expect 0 1009	RespProtocol    {^HTTP/1.1$}
 	expect 0 1009	RespStatus      {^100$}
@@ -121,9 +117,8 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1011	ReqMethod       {^POST$}
 	expect 0 1011	ReqURL          {^/err$}
 	expect 0 1011	ReqProtocol     {^HTTP/1.1$}
-	expect 0 1011	ReqHeader       {^Content-Length: 20$}
-	expect 0 1011	ReqHeader       {^X-Forwarded-For:}
-	expect 0 1011	VCL_call        {^RECV$}
+	expect * 1011	ReqHeader       {^Content-Length: 20$}
+	expect * 1011	VCL_call        {^RECV$}
 	expect 0 1011	VCL_return      {^synth$}
 	expect 0 1011	VCL_call        {^HASH$}
 	expect 0 1011	VCL_return      {^lookup$}
diff --git a/bin/varnishtest/tests/c00039.vtc b/bin/varnishtest/tests/c00039.vtc
index 370234fdf..4c36c2ac2 100644
--- a/bin/varnishtest/tests/c00039.vtc
+++ b/bin/varnishtest/tests/c00039.vtc
@@ -40,7 +40,7 @@ client c1 {
 
 client c1 {
 	# Each line is 32 bytes. Total: 32 * 8 == 256
-	send "GET /....0....5....0. HTTP/1.1\r\n"
+	send "GET /..... HTTP/1.1\r\nHost: foo\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
@@ -52,8 +52,7 @@ client c1 {
 	expect resp.status == 200
 
 	# Each line is 32 except last, which is 33. Total: 32 * 7 + 33 == 257
-	send "GET /....0....5....0. HTTP/1.1\r\n"
-	send "1...5: ..0....5....0....5....0\r\n"
+	send "GET /..... HTTP/1.1\r\nHost: foo\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
 	send "1...5: ..0....5....0....5....0\r\n"
diff --git a/bin/varnishtest/tests/e00003.vtc b/bin/varnishtest/tests/e00003.vtc
index 71c5c6308..a541596bf 100644
--- a/bin/varnishtest/tests/e00003.vtc
+++ b/bin/varnishtest/tests/e00003.vtc
@@ -33,7 +33,7 @@ varnish v1 -vcl+backend {
 logexpect l1 -v v1 -g request {
 	expect 0 1001   Begin   "^req .* rxreq"
 	# ReqAcct body counts include chunked overhead
-	expect * =	ReqAcct	"^18 0 18 187 104 291$"
+	expect * =	ReqAcct	"^29 0 29 187 104 291$"
 	expect 0 =      End
 } -start
 
@@ -57,19 +57,19 @@ logexpect l5 -v v1 -g request {
 	expect * 1005   Begin   "^req .* rxreq"
 	# ReqAcct body counts include chunked overhead
 	# Header bytes is 5 larger than in l1 due to two item X-Varnish hdr
-	expect * =	ReqAcct	"^18 0 18 192 104 296$"
+	expect * =	ReqAcct	"^29 0 29 192 104 296$"
 	expect 0 =      End
 } -start
 
 client c1 {
-	txreq
+	txreq -hdr "Host: foo"
 	rxresp
 	expect resp.bodylen == 75
 	expect resp.status == 200
 
 	delay .1
 	# test that there is no difference on miss/hit
-	txreq
+	txreq -hdr "Host: foo"
 	rxresp
 	expect resp.bodylen == 75
 	expect resp.status == 200
diff --git a/bin/varnishtest/tests/f00001.vtc b/bin/varnishtest/tests/f00001.vtc
index dc9fd9b19..2c756c9cd 100644
--- a/bin/varnishtest/tests/f00001.vtc
+++ b/bin/varnishtest/tests/f00001.vtc
@@ -12,6 +12,7 @@ varnish v1 -vcl+backend {
 
 client c1 {
 	send "POST / HTTP/1.1\r\n"
+	send "Host: foo\r\n"
 	send "Transfer-Encoding: chunked\r\n\r\n"
 	send "FFFFFFFFFFFFFFED\r\n"
 	send "0\r\n\r\n"
@@ -32,6 +33,7 @@ varnish v1 -vcl+backend {
 
 client c1 {
 	send "POST / HTTP/1.1\r\n"
+	send "Host: foo\r\n"
 	send "Transfer-Encoding: chunked\r\n\r\n"
 	send "FFFFFFFFFFFFFFED\r\n"
 
diff --git a/bin/varnishtest/tests/l00002.vtc b/bin/varnishtest/tests/l00002.vtc
index 942c8b5d9..82296bc66 100644
--- a/bin/varnishtest/tests/l00002.vtc
+++ b/bin/varnishtest/tests/l00002.vtc
@@ -24,9 +24,10 @@ varnish v1 -vcl+backend {
 
 # Request (1001):
 # GET /1 HTTP/1.1\r\n		 17 bytes
+# Host: foo\r\n			 11 bytes
 # Content-Length: 4\r\n		 19 bytes
 # \r\n				  2 bytes
-# Total:			 38 bytes
+# Total:			 49 bytes
 # Response:
 # HTTP/1.1 200 OK\r\n		 17 bytes
 # Content-Length: 1000\r\n	 22 bytes
@@ -37,8 +38,9 @@ varnish v1 -vcl+backend {
 
 # Request (1003):
 # GET /2 HTTP/1.1\r\n		 17 bytes
+# Host: foo\r\n			 11 bytes
 # \r\n				  2 bytes
-# Total:			 19 bytes
+# Total:			 30 bytes
 # Response:
 # HTTP/1.1 200 OK\r\n		 17 bytes
 # Content-Length: 2000\r\n	 22 bytes
@@ -49,8 +51,9 @@ varnish v1 -vcl+backend {
 
 # Request (1005):
 # GET /2 HTTP/1.1\r\n		 17 bytes
+# Host: foo\r\n			 11 bytes
 # \r\n				  2 bytes
-# Total:			 19 bytes
+# Total:			 30 bytes
 # Response:
 # HTTP/1.1 200 OK\r\n		 17 bytes
 # Content-Length: 2000\r\n	 22 bytes
@@ -69,13 +72,13 @@ varnish v1 -vcl+backend {
 # Total:			 28 bytes
 logexpect l1 -v v1 -g session {
 	expect * 1001	Begin	"^req .* rxreq"
-	expect * =	ReqAcct	"^38 4 42 87 1000 1087$"
+	expect * =	ReqAcct	"^49 4 53 87 1000 1087$"
 	expect 0 =	End
 	expect * 1003	Begin	"^req .* rxreq"
-	expect * =	ReqAcct "^19 0 19 87 2000 2087$"
+	expect * =	ReqAcct "^30 0 30 87 2000 2087$"
 	expect 0 =	End
 	expect * 1005	Begin	"^req .* rxreq"
-	expect * =	ReqAcct "^19 0 19 87 2000 2087$"
+	expect * =	ReqAcct "^30 0 30 87 2000 2087$"
 	expect 0 =	End
 	expect * 1006	Begin	"^req .* rxreq"
 	expect * =	ReqAcct	"^7 0 7 28 0 28$"
@@ -84,11 +87,11 @@ logexpect l1 -v v1 -g session {
 
 # Request 1001
 client c1 {
-	txreq -url "/1" -body "asdf"
+	txreq -url "/1" -hdr "Host: foo" -body "asdf"
 	rxresp
 	expect resp.status == 200
 
-	send "GET /2 HTTP/1.1\r\n\r\nGET /2 HTTP/1.1\r\n\r\n"
+	send "GET /2 HTTP/1.1\r\nHost: foo\r\n\r\nGET /2 HTTP/1.1\r\nHost: foo\r\n\r\n"
 	rxresp
 	expect resp.status == 200
 	rxresp
@@ -101,7 +104,7 @@ client c1 {
 
 logexpect l1 -wait
 
-varnish v1 -expect s_req_hdrbytes == 83
+varnish v1 -expect s_req_hdrbytes == 116
 varnish v1 -expect s_req_bodybytes == 4
 varnish v1 -expect s_resp_hdrbytes == 289
 varnish v1 -expect s_resp_bodybytes == 5000
diff --git a/bin/varnishtest/tests/l00003.vtc b/bin/varnishtest/tests/l00003.vtc
index 6ef90a3db..bdc23333c 100644
--- a/bin/varnishtest/tests/l00003.vtc
+++ b/bin/varnishtest/tests/l00003.vtc
@@ -30,8 +30,9 @@ varnish v1 -vcl+backend {
 
 # Request (1001):
 # GET / HTTP/1.1\r\n			16 bytes
+# Host: foo\r\n				11 bytes
 # \r\n					 2 bytes
-# Total:				18 bytes
+# Total:				29 bytes
 
 # Reponse:
 # HTTP/1.1 200 OK\r\n			17 bytes
@@ -62,7 +63,7 @@ varnish v1 -vcl+backend {
 
 logexpect l1 -v v1 -g request {
 	expect 0 1001	Begin	"^req .* rxreq"
-	expect * =	ReqAcct		"^18 0 18 93 55 148$"
+	expect * =	ReqAcct		"^29 0 29 93 55 148$"
 	expect 0 =	End
 	expect * 1003	Begin		"^req .* esi"
 	expect * =	ReqAcct		"^0 0 0 0 12 12$"
@@ -76,7 +77,7 @@ logexpect l1 -v v1 -g request {
 } -start
 
 client c1 {
-	txreq -url "/"
+	txreq -url "/" -hdr "Host: foo"
 	rxresp
 	expect resp.status == 200
 	expect resp.body == "123abc123defghi"
@@ -84,7 +85,7 @@ client c1 {
 
 logexpect l1 -wait
 
-varnish v1 -expect s_req_hdrbytes == 18
+varnish v1 -expect s_req_hdrbytes == 29
 varnish v1 -expect s_req_bodybytes == 0
 varnish v1 -expect s_resp_hdrbytes == 93
 varnish v1 -expect s_resp_bodybytes == 55
diff --git a/bin/varnishtest/tests/l00004.vtc b/bin/varnishtest/tests/l00004.vtc
index 22e5ea33b..95ad36111 100644
--- a/bin/varnishtest/tests/l00004.vtc
+++ b/bin/varnishtest/tests/l00004.vtc
@@ -22,9 +22,10 @@ varnish v1 -vcl+backend {
 
 # req:
 # POST / HTTP/1.1\r\n			17 bytes
+# Host: foo\r\n				11 bytes
 # Content-Length: 4\r\n			19 bytes
 # \r\n					 2 bytes
-# Total:				38 bytes
+# Total:				49 bytes
 
 # bereq:
 # POST / HTTP/1.1\r\n			17 bytes
@@ -45,12 +46,12 @@ varnish v1 -vcl+backend {
 
 logexpect l1 -v v1 -g request {
 	expect 0 1001	Begin		"^req .* rxreq"
-	expect * =	PipeAcct	"^38 49 4 42$"
+	expect * =	PipeAcct	"^49 60 4 42$"
 	expect 0 =	End
 } -start
 
 client c1 {
-	txreq -req "POST" -url "/" -hdr "Content-Length: 4"
+	txreq -req "POST" -url "/" -hdr "Content-Length: 4" -hdr "Host: foo"
 	send "asdf"
 	rxresp
 	expect resp.status == 200
@@ -58,6 +59,6 @@ client c1 {
 
 logexpect l1 -wait
 
-varnish v1 -expect s_pipe_hdrbytes == 38
+varnish v1 -expect s_pipe_hdrbytes == 49
 varnish v1 -expect s_pipe_in == 4
 varnish v1 -expect s_pipe_out == 42
diff --git a/bin/varnishtest/tests/o00000.vtc b/bin/varnishtest/tests/o00000.vtc
index 3bb7cd511..1e5dcabf8 100644
--- a/bin/varnishtest/tests/o00000.vtc
+++ b/bin/varnishtest/tests/o00000.vtc
@@ -199,7 +199,7 @@ delay .1
 
 # Try with appended request (See also: #1728)
 client c2 {
-	send "PROXY TCP6 1:f::3 5:a::8 1234 5678\r\nGET /3 HTTP/1.1\r\nHdr1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n\r\n"
+	send "PROXY TCP6 1:f::3 5:a::8 1234 5678\r\nGET /3 HTTP/1.1\r\nHost: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n\r\n"
 	rxresp
 	expect resp.http.url == "/3"
 } -run
diff --git a/bin/varnishtest/tests/o00001.vtc b/bin/varnishtest/tests/o00001.vtc
index ae6e388e0..ef78b2d95 100644
--- a/bin/varnishtest/tests/o00001.vtc
+++ b/bin/varnishtest/tests/o00001.vtc
@@ -1,17 +1,40 @@
 varnishtest "PROXY v2 test"
 
 server s1 {
-	# The server address is part of the hash-key
-	# so we need three responses
 	rxreq
+	expect req.url == "/1"
 	expect req.http.x-forwarded-for == "${localhost}"
-	txresp -hdr "Obj: 1"
+	txresp
+
+	rxreq
+	expect req.url == "/2"
+	expect req.http.x-forwarded-for == "${localhost}"
+	txresp
+
 	rxreq
+	expect req.url == "/3"
+	expect req.http.x-forwarded-for == "${localhost}"
+	txresp
+
+	rxreq
+	expect req.url == "/4"
+	expect req.http.x-forwarded-for == "${localhost}"
+	txresp
+
+	rxreq
+	expect req.url == "/5"
+	expect req.http.x-forwarded-for == "${localhost}"
+	txresp
+
+	rxreq
+	expect req.url == "/6"
 	expect req.http.x-forwarded-for == "1.2.3.4"
-	txresp -hdr "Obj: 2"
+	txresp
+
 	rxreq
+	expect req.url == "/7"
 	expect req.http.x-forwarded-for == "102:304:506::d0e:f10"
-	txresp -hdr "Obj: 3"
+	txresp
 } -start
 
 varnish v1 -proto "PROXY" -vcl+backend {
@@ -21,6 +44,7 @@ varnish v1 -proto "PROXY" -vcl+backend {
 		"1.2.3.4";
 		"102:304:506::d0e:f10";
 	}
+
 	acl fwd_server {
 		"5.6.7.8";
 		"8182:8384:8586::8d8e:8f80";
@@ -44,18 +68,18 @@ logexpect l1 -v v1 -g raw {
 	expect * 1000	Proxy		"2 local local local local"
 	expect * 1003	ProxyGarbage	"PROXY2: bad command \\(2\\)"
 	expect * 1004	ProxyGarbage	"PROXY2: Ignoring UNSPEC\\|UNSPEC addresses"
-	expect * 1006	ProxyGarbage	"PROXY2: Ignoring unsupported protocol \\(0x99\\)"
-	expect * 1008	ProxyGarbage	"PROXY2: Ignoring short IPv4 addresses \\(11\\)"
-	expect * 1010	ProxyGarbage	"PROXY2: Ignoring short IPv6 addresses \\(35\\)"
-	expect * 1012	Proxy		"2 1.2.3.4 2314 5.6.7.8 2828"
-	expect * 1015	Proxy		"2 102:304:506::d0e:f10 2314 8182:8384:8586::8d8e:8f80 2828"
+	expect * 1007	ProxyGarbage	"PROXY2: Ignoring unsupported protocol \\(0x99\\)"
+	expect * 1010	ProxyGarbage	"PROXY2: Ignoring short IPv4 addresses \\(11\\)"
+	expect * 1013	ProxyGarbage	"PROXY2: Ignoring short IPv6 addresses \\(35\\)"
+	expect * 1016	Proxy		"2 1.2.3.4 2314 5.6.7.8 2828"
+	expect * 1019	Proxy		"2 102:304:506::d0e:f10 2314 8182:8384:8586::8d8e:8f80 2828"
 } -start
 
 client c1 {
 	# LOCAL command
 	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
 	sendhex "20 00 00 00"
-	txreq
+	txreq -url /1
 	rxresp
 	expect resp.status == 200
 	expect resp.http.si == "${v1_addr}"
@@ -79,7 +103,7 @@ client c1 {
 	# UNSPEC proto
 	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
 	sendhex "21 00 00 00"
-	txreq
+	txreq -url /2
 	rxresp
 	expect resp.status == 200
 	expect resp.http.si == "${v1_addr}"
@@ -93,7 +117,7 @@ client c1 {
 	# unknown proto
 	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
 	sendhex "21 99 00 00"
-	txreq
+	txreq -url /3
 	rxresp
 	expect resp.status == 200
 	expect resp.http.si == "${v1_addr}"
@@ -108,7 +132,7 @@ client c1 {
 	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
 	sendhex "21 11 00 0b"
 	sendhex "01 02 03 04 05 06 07 08 09 0a 0b"
-	txreq
+	txreq -url /4
 	rxresp
 	expect resp.status == 200
 	expect resp.http.si == "${v1_addr}"
@@ -125,7 +149,7 @@ client c1 {
 	sendhex "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"
 	sendhex "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"
 	sendhex "01 02 03"
-	txreq
+	txreq -url /5
 	rxresp
 	expect resp.status == 200
 	expect resp.http.fs == false
@@ -138,10 +162,9 @@ delay .1
 
 # good IPv4
 client c1 -proxy2 "1.2.3.4:2314 5.6.7.8:2828" {
-	txreq
+	txreq -url /6
 	rxresp
 	expect resp.status == 200
-	expect resp.http.obj == 2
 	expect resp.http.fs == true
 	expect resp.http.fc == true
 	expect resp.http.ci == "1.2.3.4"
@@ -158,10 +181,9 @@ delay .1
 # good IPv6
 client c1 \
     -proxy2 "[102:304:506::d0e:f10]:2314 [8182:8384:8586::8d8e:8f80]:2828" {
-	txreq
+	txreq -url /7
 	rxresp
 	expect resp.status == 200
-	expect resp.http.obj == 3
 	expect resp.http.fs == true
 	expect resp.http.fc == true
 	expect resp.http.ci == "102:304:506::d0e:f10"
diff --git a/bin/varnishtest/tests/r00262.vtc b/bin/varnishtest/tests/r00262.vtc
index b5a9efc8e..698a0b068 100644
--- a/bin/varnishtest/tests/r00262.vtc
+++ b/bin/varnishtest/tests/r00262.vtc
@@ -10,13 +10,13 @@ server s1 {
 varnish v1 -arg "-p timeout_linger=20" -vcl+backend { } -start
 
 client c1 {
-	send "GET / HTTP/1.1\r\n\r\n\r\n"
+	send "GET / HTTP/1.1\r\nHost: foo\r\n\r\n\r\n"
 
 	rxresp
 	expect resp.status == 200
 	expect resp.http.X-Varnish == "1001"
 
-	send "GET / HTTP/1.1\r\n\r\n"
+	send "GET / HTTP/1.1\r\nHost: foo\r\n\r\n"
 	rxresp
 	expect resp.status == 200
 	expect resp.http.X-Varnish == "1003 1002"
diff --git a/bin/varnishtest/tests/r01729.vtc b/bin/varnishtest/tests/r01729.vtc
index 1a68f5bbc..883a60cc6 100644
--- a/bin/varnishtest/tests/r01729.vtc
+++ b/bin/varnishtest/tests/r01729.vtc
@@ -23,6 +23,7 @@ client c1 {
 
 	non_fatal
 	send "PUT /1 HTTP/1.1\r\n"
+	send "Host: foo\r\n"
 	send "Content-Length: 31\r\n"
 	send "Transfer-Encoding: chunked\r\n"
 	send "\r\n"
@@ -39,6 +40,7 @@ client c1 {
 client c1 {
 	fatal
 	send "PUT /2 HTTP/1.1\r\n"
+	send "Host: foo\r\n"
 	send "Transfer-Encoding: chunked\r\n"
 	send "\r\n"
 	send "14\r\n"
diff --git a/bin/varnishtest/tests/r01847.vtc b/bin/varnishtest/tests/r01847.vtc
index a163fe3b7..ac764ee89 100644
--- a/bin/varnishtest/tests/r01847.vtc
+++ b/bin/varnishtest/tests/r01847.vtc
@@ -24,9 +24,9 @@ client c1 {
 	expect resp.http.rxhost == www.example.com
 	expect resp.http.rxurl == /bar
 
-	txreq -url https://www.example.com/bar
+	txreq -url https://www.example.com/bar -hdr "Host: ${localhost}"
 	rxresp
-	expect resp.http.rxhost == ""
+	expect resp.http.rxhost == "${localhost}"
 	expect resp.http.rxurl == https://www.example.com/bar
 } -run
 
diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc
index f73530df5..197e5a89d 100644
--- a/bin/varnishtest/tests/u00003.vtc
+++ b/bin/varnishtest/tests/u00003.vtc
@@ -32,9 +32,9 @@ shell {
 delay 1
 
 client c1 {
-	txreq -url /1?foo=bar -hdr "authorization: basic dXNlcjpwYXNz"
+	txreq -url /1?foo=bar -hdr "authorization: basic dXNlcjpwYXNz" -hdr "Host: ${localhost}"
 	rxresp
-	txreq -url /1?foo=bar -hdr "baz: qux"
+	txreq -url /1?foo=bar -hdr "baz: qux" -hdr "Host: ${localhost}"
 	rxresp
 } -run
 
@@ -44,7 +44,7 @@ shell "mv ${tmpdir}/ncsa.log ${tmpdir}/ncsa.old.log"
 shell "kill -HUP `cat ${tmpdir}/ncsa.pid`"
 
 client c1 {
-	txreq -url /2
+	txreq -url /2 -hdr "Host: ${localhost}"
 	rxresp
 } -run
 
@@ -53,10 +53,10 @@ delay 1
 shell "kill `cat ${tmpdir}/ncsa.pid`"
 
 # default formatter and rotation
-shell -match {^\d+.\d+.\d+.\d+ - user \[../.../20[1-9][0-9]:..:..:.. (?#
-)[+-]....\] "GET http://localhost/1\?foo=bar HTTP/1.1" 200 100 "-" "-"
-\d+.\d+.\d+.\d+ - - \[../.../20[1-9][0-9]:..:..:.. [+-]....\] (?#
-)"GET http://localhost/1\?foo=bar HTTP/1.1" 404 \d+ "-" "-"$} \
+shell -match {${localhost} - user \[../.../20[1-9][0-9]:..:..:.. (?#
+)[+-]....\] "GET http://${localhost}/1\?foo=bar HTTP/1.1" 200 100 "-" "-"
+${localhost} - - \[../.../20[1-9][0-9]:..:..:.. [+-]....\] (?#
+)"GET http://${localhost}/1\?foo=bar HTTP/1.1" 404 \d+ "-" "-"$} \
 	"cat ${tmpdir}/ncsa.old.log"
 shell "grep -q /2 ${tmpdir}/ncsa.log"
 
@@ -111,13 +111,13 @@ shell -err -match "Usage: .*varnishncsa <options>" \
 	{varnishncsa extra}
 
 # -b
-shell -match {^\d+.\d+.\d+.\d+ 100
-- 0$} \
+shell -match {^${localhost} 100
+${localhost} 0$} \
 	{varnishncsa -n ${v1_name} -b -d -F "%{Host}i %b"}
 # -c
-shell -match {^- 100
-- \d+
-- -$} \
+shell -match {^${localhost} 100
+${localhost} \d+
+${localhost} -$} \
 	{varnishncsa -n ${v1_name} -c -d -F "%{Host}i %b"}
 
 # -f and standard formatters
diff --git a/bin/varnishtest/tests/u00013.vtc b/bin/varnishtest/tests/u00013.vtc
index 411bba8f3..133d9992a 100644
--- a/bin/varnishtest/tests/u00013.vtc
+++ b/bin/varnishtest/tests/u00013.vtc
@@ -3,8 +3,8 @@ varnishtest "varnishncsa outputs when UDS addresses are in use"
 # The %h formatter gets its value from ReqStart or BackendStart,
 # which now may be a UDS address.
 
-# For UDS backends without a .hosthdr setting, the Host header is
-# set to "0.0.0.0", which may appear in %r output.
+# For UDS backends without a .host_header spec, the Host header is
+# set to "0.0.0.0" if the header is missing in the request.
 
 server s1 -listen "${tmpdir}/s1.sock" {
 	rxreq
@@ -14,7 +14,7 @@ server s1 -listen "${tmpdir}/s1.sock" {
 varnish v1 -arg "-a ${tmpdir}/v1.sock" -vcl+backend {} -start
 
 client c1 -connect "${tmpdir}/v1.sock" {
-	txreq
+	txreq -proto HTTP/1.0
 	rxresp
 } -run
 
diff --git a/bin/varnishtest/tests/v00008.vtc b/bin/varnishtest/tests/v00008.vtc
index 95a870ff2..42798f2b3 100644
--- a/bin/varnishtest/tests/v00008.vtc
+++ b/bin/varnishtest/tests/v00008.vtc
@@ -17,7 +17,7 @@ varnish v1 -vcl+backend { } -start
 client c1 {
 	txreq -url "/foo" -hdr "Host: snafu"
 	rxresp
-	txreq -url "/bar"
+	txreq -url "/bar" -proto HTTP/1.0
 	rxresp
 } -run
 
@@ -37,6 +37,6 @@ varnish v1 -vcl {
 }
 
 client c1 {
-	txreq -url "/barf"
+	txreq -url "/barf" -proto HTTP/1.0
 	rxresp
 } -run
diff --git a/bin/varnishtest/tests/v00057.vtc b/bin/varnishtest/tests/v00057.vtc
index 58d8de3c6..01a177b1e 100644
--- a/bin/varnishtest/tests/v00057.vtc
+++ b/bin/varnishtest/tests/v00057.vtc
@@ -1,4 +1,4 @@
-varnishtest "Test backend .hosthdr with UDS backends"
+varnishtest "Test host header specification with UDS backends"
 
 server s1 -listen "${tmpdir}/s1.sock" {
 	rxreq
@@ -17,7 +17,7 @@ varnish v1 -vcl+backend { } -start
 client c1 {
 	txreq -url "/foo" -hdr "Host: snafu"
 	rxresp
-	txreq -url "/bar"
+	txreq -url "/bar" -proto HTTP/1.0
 	rxresp
 } -run
 
@@ -36,6 +36,6 @@ varnish v1 -vcl {
 }
 
 client c1 {
-	txreq -url "/barf"
+	txreq -url "/barf" -proto HTTP/1.0
 	rxresp
 } -run


More information about the varnish-commit mailing list