[master] db211eb Don't expect IMS to happen on zero-length objects.

Poul-Henning Kamp phk at FreeBSD.org
Sat Mar 12 01:29:04 CET 2016


commit db211ebff38905da98cae2db10aa75c6c87c7a79
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Mar 11 23:03:30 2016 +0000

    Don't expect IMS to happen on zero-length objects.

diff --git a/bin/varnishtest/tests/c00072.vtc b/bin/varnishtest/tests/c00072.vtc
index 19453a0..093711c 100644
--- a/bin/varnishtest/tests/c00072.vtc
+++ b/bin/varnishtest/tests/c00072.vtc
@@ -2,15 +2,17 @@ varnishtest "purge stale on refresh with and without IMS"
 
 server s1 {
 	rxreq
-	txresp -hdr "foo: bar"
+	expect req.url == /no-ims
+	txresp -hdr "foo: bar" -body "1"
 	rxreq
-	txresp -hdr "foo: bar" -hdr {ETag: "asdf"}
+	expect req.url == /ims
+	txresp -hdr "foo: bar" -hdr {ETag: "asdf"} -body "12"
 
 	rxreq
-	txresp -hdr "foo: baz"
+	txresp -hdr "foo: baz" -body "123"
 	rxreq
 	expect req.http.if-none-match == {"asdf"}
-	txresp -status 304 -nolen -hdr "foo: baz"
+	txresp -status 304 -nolen -hdr "foo: bazf"
 } -start
 
 varnish v1 -vcl+backend {
@@ -24,9 +26,12 @@ varnish v1 -vcl+backend {
 client c1 {
 	txreq -url /no-ims
 	rxresp
+	expect resp.bodylen == 1
 	expect resp.http.foo == "bar"
+
 	txreq -url /ims
 	rxresp
+	expect resp.bodylen == 2
 	expect resp.http.foo == "bar"
 } -run
 
@@ -37,10 +42,13 @@ varnish v1 -expect n_object == 2
 client c1 {
 	txreq -url /no-ims
 	rxresp
+	expect resp.bodylen == 3
 	expect resp.http.foo == "baz"
+
 	txreq -url /ims
 	rxresp
-	expect resp.http.foo == "baz"
+	expect resp.bodylen == 2
+	expect resp.http.foo == "bazf"
 } -run
 
 # Make sure expiry is done
diff --git a/bin/varnishtest/tests/r01485.vtc b/bin/varnishtest/tests/r01485.vtc
index abfe839..14aba70 100644
--- a/bin/varnishtest/tests/r01485.vtc
+++ b/bin/varnishtest/tests/r01485.vtc
@@ -2,7 +2,7 @@ varnishtest "#1485: Wrong response reason phrase"
 
 server s1 {
 	rxreq
-	txresp -hdr {Etag: "foo"}
+	txresp -hdr {Etag: "foo"} -body "1"
 
 	rxreq
 	expect req.http.If-None-Match == {"foo"}
@@ -21,6 +21,7 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
+	expect resp.bodylen == 1
 	expect resp.msg == "OK"
 
 	delay 0.1
@@ -28,5 +29,6 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
+	expect resp.bodylen == 1
 	expect resp.msg == "OK"
 } -run
diff --git a/bin/varnishtest/tests/r01499.vtc b/bin/varnishtest/tests/r01499.vtc
index fb9ec15..4f313e5 100644
--- a/bin/varnishtest/tests/r01499.vtc
+++ b/bin/varnishtest/tests/r01499.vtc
@@ -2,10 +2,10 @@ varnishtest "#1499 - objcore ref leak on IMS update"
 
 server s1 {
 	rxreq
-	txresp -hdr {Etag: "foo"}
+	txresp -hdr {Etag: "foo"} -body {1}
 	rxreq
 	expect req.http.if-none-match == {"foo"}
-	txresp -hdr "X-Resp: 2"
+	txresp -hdr "X-Resp: 2" -body {12}
 } -start
 
 varnish v1 -vcl+backend {
@@ -19,12 +19,14 @@ varnish v1 -vcl+backend {
 client c1 {
 	txreq
 	rxresp
+	expect resp.bodylen == 1
 
 	delay 0.5
 
 	txreq
 	rxresp
 	expect resp.http.x-resp == "2"
+	expect resp.bodylen == 2
 } -run
 
 delay 3



More information about the varnish-commit mailing list