[master] f1d60c1 ESI vtcs: coverage, fixes, check ESI_xmlerror, esi_disable_xml_check

Nils Goroll nils.goroll at uplex.de
Sat Nov 4 17:55:11 UTC 2017


commit f1d60c1c7133f72c23bc7992212d8839acf93cf5
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Nov 4 15:09:21 2017 +0100

    ESI vtcs: coverage, fixes, check ESI_xmlerror, esi_disable_xml_check
    
    We were tolerating some unintentional ESI behaviour due to the
    xml check hitting.
    
    We now either avoid running into the xml check or specifically
    test that we are hitting it.
    
    In addition, add some logexpects to tighten checks

diff --git a/bin/varnishtest/tests/e00000.vtc b/bin/varnishtest/tests/e00000.vtc
index e17338f..8448550 100644
--- a/bin/varnishtest/tests/e00000.vtc
+++ b/bin/varnishtest/tests/e00000.vtc
@@ -14,6 +14,10 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * * ESI_xmlerror esi_disable_xml_check
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -22,4 +26,5 @@ client c1 {
 }
 
 client c1 -run
+logexpect l1 -wait
 varnish v1 -expect esi_errors == 0
diff --git a/bin/varnishtest/tests/e00001.vtc b/bin/varnishtest/tests/e00001.vtc
index 660637d..be0b0c1 100644
--- a/bin/varnishtest/tests/e00001.vtc
+++ b/bin/varnishtest/tests/e00001.vtc
@@ -19,6 +19,11 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * * ESI_xmlerror {^ERR after 3 ESI 1.0 <esi:include> element nested in <esi:remove>}
+	expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 Nested <!--esi element in <esi:remove>}
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -27,4 +32,5 @@ client c1 {
 }
 
 client c1 -run
+logexpect l1 -wait
 varnish v1 -expect esi_errors == 2
diff --git a/bin/varnishtest/tests/e00003.vtc b/bin/varnishtest/tests/e00003.vtc
index 0ff09d8..b3e65fa 100644
--- a/bin/varnishtest/tests/e00003.vtc
+++ b/bin/varnishtest/tests/e00003.vtc
@@ -24,7 +24,9 @@ varnish v1 -vcl+backend {
 		}
 	}
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/e00004.vtc b/bin/varnishtest/tests/e00004.vtc
index 7326cb5..9e19b66 100644
--- a/bin/varnishtest/tests/e00004.vtc
+++ b/bin/varnishtest/tests/e00004.vtc
@@ -18,7 +18,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url != "/body") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/e00005.vtc b/bin/varnishtest/tests/e00005.vtc
index 76a82ab..832a6ee 100644
--- a/bin/varnishtest/tests/e00005.vtc
+++ b/bin/varnishtest/tests/e00005.vtc
@@ -19,7 +19,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url != "/foo/body") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/e00006.vtc b/bin/varnishtest/tests/e00006.vtc
index 95dd08d..e1b7319 100644
--- a/bin/varnishtest/tests/e00006.vtc
+++ b/bin/varnishtest/tests/e00006.vtc
@@ -17,7 +17,7 @@ server s2 {
 	rxreq
 	expect req.url == "/body"
 	txresp -body {
-		Included file
+		<pre>Included file</pre>
 	}
 } -start
 
@@ -38,7 +38,7 @@ client c1 {
 	txreq -url /foo/bar -hdr "Host: froboz"
 	rxresp
 	expect resp.status == 200
-	expect resp.bodylen == 67
+	expect resp.bodylen == 78
 }
 
 client c1 -run
@@ -71,8 +71,6 @@ logexpect l1 -v v1 -g raw {
 	expect * * ESI_xmlerror "ERR after 0 ESI 1.0 <esi:include> invalid src= URL"
 	expect * * ESI_xmlerror "WARN after 0 ESI 1.0 <esi:include> https:// treated as http://"
 	expect * * ESI_xmlerror "ERR after 0 ESI 1.0 <esi:include> invalid src= URL"
-
-
 } -start
 
 client c1 {
diff --git a/bin/varnishtest/tests/e00008.vtc b/bin/varnishtest/tests/e00008.vtc
index 8767b73..1477341 100644
--- a/bin/varnishtest/tests/e00008.vtc
+++ b/bin/varnishtest/tests/e00008.vtc
@@ -45,14 +45,14 @@ server s1 {
 	rxreq
 	expect req.url == "/body"
 	txresp -body {
-		Included file
+		<pre>Included file</pre>
 		<esi:remove>
 		<Aaa
 	}
 	rxreq
 	expect req.url == "/body2"
 	txresp -body {
-		Included file 2
+		<pre>Included file 2</pre>
 		<!--esi
 		<![CDATA[fooo
 	}
@@ -81,7 +81,20 @@ logexpect l1 -v v1 -g vxid {
 	expect 0 = ESI_xmlerror {^ERR after 636 XML 1.0 Illegal attribute delimiter$}
 	expect 0 = ESI_xmlerror {^ERR after 665 ESI 1.0 </esi:include> illegal end-tag$}
 	expect 0 = ESI_xmlerror {^ERR after 767 XML 1.0 Missing end attribute delimiter$}
-}
+	expect 0 = BackendReuse
+
+## XXX something is fishy about any of: logexpect, vsl, slink's brain:
+## despite syncvsl and the fact that the loggin is output by
+## varnishtest, these fail (time out) - feedback appreciated
+#
+#	expect * * BereqURL	{^/body$}
+#	expect * = ESI_xmlerror {^ERR after 39 VEP ended inside a tag$}
+#	expect 0 = BackendReuse
+#
+#	expect * * BereqURL	{^/body2$}
+#	expect * = ESI_xmlerror {^ERR after 39 VEP ended inside a tag$}
+#	expect 0 = BackendReuse
+} -start
 
 varnish v1 -cliok "param.set debug +esi_chop"
 
@@ -91,10 +104,9 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
-	expect resp.bodylen == 464
+	expect resp.bodylen == 465
 }
 
-logexpect l1 -start
 client c1 -run
 logexpect l1 -wait
-varnish v1 -expect esi_errors == 15
+varnish v1 -expect esi_errors == 17
diff --git a/bin/varnishtest/tests/e00009.vtc b/bin/varnishtest/tests/e00009.vtc
index 03bc28c..70a8206 100644
--- a/bin/varnishtest/tests/e00009.vtc
+++ b/bin/varnishtest/tests/e00009.vtc
@@ -23,6 +23,10 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * 1002 ESI_xmlerror esi_disable_xml_check
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -30,6 +34,8 @@ client c1 {
 	expect resp.bodylen == 57
 } -run
 
+logexpect l1 -wait
+
 varnish v1  -cli "param.set feature +esi_disable_xml_check"
 
 client c1 {
diff --git a/bin/varnishtest/tests/e00012.vtc b/bin/varnishtest/tests/e00012.vtc
index 8ee2eca..0786c21 100644
--- a/bin/varnishtest/tests/e00012.vtc
+++ b/bin/varnishtest/tests/e00012.vtc
@@ -18,7 +18,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url != "/foo/body") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
@@ -27,6 +29,7 @@ client c1 {
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 67
+	expect resp.http.Transfer-Encoding == "chunked"
 } -run
 
 client c1 {
@@ -34,6 +37,9 @@ client c1 {
 	rxresp
 	expect resp.status == 200
 	expect resp.bodylen == 67
+	expect resp.http.Transfer-Encoding == <undef>
+	expect resp.http.Content-Length == <undef>
+	expect resp.http.Connection == "close"
 } -run
 
 varnish v1 -expect esi_errors == 0
diff --git a/bin/varnishtest/tests/e00015.vtc b/bin/varnishtest/tests/e00015.vtc
index 7d09441..daaea75 100644
--- a/bin/varnishtest/tests/e00015.vtc
+++ b/bin/varnishtest/tests/e00015.vtc
@@ -18,7 +18,7 @@ server s1 {
 	rxreq
 	expect req.url == "/body"
 	txresp -body {
-		Included file
+		<pre>Included file</pre>
 	}
 } -start
 
@@ -40,7 +40,7 @@ client c1 {
 	expect resp.status == 200
 	txreq -url "/esi"
 	rxresp
-	expect resp.bodylen == 65
+	expect resp.bodylen == 76
 	expect resp.status == 200
 }
 
diff --git a/bin/varnishtest/tests/e00016.vtc b/bin/varnishtest/tests/e00016.vtc
index d256c28..7cf78cc 100644
--- a/bin/varnishtest/tests/e00016.vtc
+++ b/bin/varnishtest/tests/e00016.vtc
@@ -26,7 +26,7 @@ server s1 {
 	}
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/e00017.vtc b/bin/varnishtest/tests/e00017.vtc
index 1ced505..dd50ced 100644
--- a/bin/varnishtest/tests/e00017.vtc
+++ b/bin/varnishtest/tests/e00017.vtc
@@ -29,45 +29,45 @@ server s1 {
 		After include
 	}
 	rxreq
-	txresp -body { Included file 00 }
+	txresp -body { <pre>Included file 00</pre> }
 	rxreq
-	txresp -body { Included file 01 }
+	txresp -body { <pre>Included file 01</pre> }
 	rxreq
-	txresp -body { Included file 02 }
+	txresp -body { <pre>Included file 02</pre> }
 	rxreq
-	txresp -body { Included file 03 }
+	txresp -body { <pre>Included file 03</pre> }
 	rxreq
-	txresp -body { Included file 04 }
+	txresp -body { <pre>Included file 04</pre> }
 	rxreq
-	txresp -body { Included file 05 }
+	txresp -body { <pre>Included file 05</pre> }
 	rxreq
-	txresp -body { Included file 06 }
+	txresp -body { <pre>Included file 06</pre> }
 	rxreq
-	txresp -body { Included file 07 }
+	txresp -body { <pre>Included file 07</pre> }
 	rxreq
-	txresp -body { Included file 08 }
+	txresp -body { <pre>Included file 08</pre> }
 	rxreq
-	txresp -body { Included file 09 }
+	txresp -body { <pre>Included file 09</pre> }
 	rxreq
-	txresp -body { Included file 10 }
+	txresp -body { <pre>Included file 10</pre> }
 	rxreq
-	txresp -body { Included file 11 }
+	txresp -body { <pre>Included file 11</pre> }
 	rxreq
-	txresp -body { Included file 12 }
+	txresp -body { <pre>Included file 12</pre> }
 	rxreq
-	txresp -body { Included file 13 }
+	txresp -body { <pre>Included file 13</pre> }
 	rxreq
-	txresp -body { Included file 14 }
+	txresp -body { <pre>Included file 14</pre> }
 	rxreq
-	txresp -body { Included file 15 }
+	txresp -body { <pre>Included file 15</pre> }
 	rxreq
-	txresp -body { Included file 16 }
+	txresp -body { <pre>Included file 16</pre> }
 	rxreq
-	txresp -body { Included file 17 }
+	txresp -body { <pre>Included file 17</pre> }
 	rxreq
-	txresp -body { Included file 18 }
+	txresp -body { <pre>Included file 18</pre> }
 	rxreq
-	txresp -body { Included file 19 }
+	txresp -body { <pre>Included file 19</pre> }
 } -start
 
 varnish v1 -vcl+backend {
@@ -80,6 +80,8 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
+	# before 29, includes 20*(29+3), after 15
+	expect resp.bodylen == 684
 }
 
 client c1 -run
diff --git a/bin/varnishtest/tests/e00018.vtc b/bin/varnishtest/tests/e00018.vtc
index 4a410cd..bf827b5 100644
--- a/bin/varnishtest/tests/e00018.vtc
+++ b/bin/varnishtest/tests/e00018.vtc
@@ -37,7 +37,9 @@ varnish v1 -vcl+backend {
 		return (pass);
 	}
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/e00019.vtc b/bin/varnishtest/tests/e00019.vtc
index 88aa405..0bf98e0 100644
--- a/bin/varnishtest/tests/e00019.vtc
+++ b/bin/varnishtest/tests/e00019.vtc
@@ -55,6 +55,17 @@ varnish v1 -vcl+backend {
 varnish v1 -cliok "param.set debug +esi_chop"
 varnish v1 -cliok "param.set debug +syncvsl"
 
+logexpect l1 -v v1 -g raw {
+	expect * * Fetch_Body   {^2 chunked -$}
+	expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 </esi:comment> illegal end-tag$}
+	expect 0 = ESI_xmlerror {^ERR after 27 XML 1.0 '>' does not follow '/' in tag$}
+	expect 0 = ESI_xmlerror {^ERR after 43 ESI 1.0 <esi:comment> needs final '/'$}
+	expect 0 = ESI_xmlerror {^WARN after 107 ESI 1.0 <esi:include> lacks final '/'$}
+	expect 0 = ESI_xmlerror {^ERR after 130 ESI 1.0 <esi:bogus> element$}
+	expect 0 = ESI_xmlerror {^ERR after 131837 VEP ended inside a tag$}
+	expect 0 = BackendReuse {^25 vcl1.s1$}
+} -start
+
 client c1 {
 	txreq  -url bar
 	rxresp
@@ -62,5 +73,7 @@ client c1 {
 	expect resp.bodylen == 65856
 } -run
 
+logexpect l1 -wait
+
 varnish v1 -expect esi_errors == 5
 varnish v1 -expect esi_warnings == 1
diff --git a/bin/varnishtest/tests/e00020.vtc b/bin/varnishtest/tests/e00020.vtc
index 9913e33..7c27efa 100644
--- a/bin/varnishtest/tests/e00020.vtc
+++ b/bin/varnishtest/tests/e00020.vtc
@@ -22,6 +22,14 @@ varnish v1 -vcl+backend {
 
 varnish v1 -cliok "param.set http_gzip_support true"
 
+logexpect l1 -v v1 -g vxid {
+	expect * * Fetch_Body
+	expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 <esi:include> element nested in <esi:remove>$}
+	expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 Nested <!--esi element in <esi:remove>$}
+	expect 0 = Gzip         {^U}
+	expect 0 = BackendReuse
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -31,3 +39,4 @@ client c1 {
 
 client c1 -run
 varnish v1 -expect esi_errors == 2
+logexpect l1 -wait
diff --git a/bin/varnishtest/tests/e00022.vtc b/bin/varnishtest/tests/e00022.vtc
index ecc606b..65e14d1 100644
--- a/bin/varnishtest/tests/e00022.vtc
+++ b/bin/varnishtest/tests/e00022.vtc
@@ -27,6 +27,15 @@ varnish v1 -cliok "param.set debug +esi_chop"
 varnish v1 -cliok "param.set http_gzip_support true"
 varnish v1 -cliok "param.set gzip_memlevel 1"
 
+logexpect l1 -v v1 -g vxid {
+	expect * * Fetch_Body
+	expect 0 = ESI_xmlerror {^ERR after 24 ESI 1.0 <esi:include> element nested in <esi:remove>$}
+	expect 0 = ESI_xmlerror {^ERR after 24 ESI 1.0 Nested <!--esi element in <esi:remove>$}
+	expect 0 = Gzip         {^G}
+	expect 0 = Gzip         {^U}
+	expect 0 = BackendReuse
+} -start
+
 client c1 {
 	txreq  -hdr "Accept-Encoding: gzip"
 	rxresp
@@ -38,3 +47,4 @@ client c1 {
 
 client c1 -run
 varnish v1 -expect esi_errors == 2
+logexpect l1 -wait
diff --git a/bin/varnishtest/tests/e00028.vtc b/bin/varnishtest/tests/e00028.vtc
index a32814c..9a5fe16 100644
--- a/bin/varnishtest/tests/e00028.vtc
+++ b/bin/varnishtest/tests/e00028.vtc
@@ -34,7 +34,7 @@ server s1 {
 	txresp -hdr "Vary: fooqux, Accept-Encoding" -gzipbody "fooqux"
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 		if (bereq.url ~ "/baz") {
diff --git a/bin/varnishtest/tests/e00030.vtc b/bin/varnishtest/tests/e00030.vtc
index 7779f98..eaa998a 100644
--- a/bin/varnishtest/tests/e00030.vtc
+++ b/bin/varnishtest/tests/e00030.vtc
@@ -1,6 +1,7 @@
 varnishtest "Test req_top.* in an ESI context"
 
-varnish v1 -errvcl {Variable 'req_top.url' is read only.} {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" \
+	   -errvcl {Variable 'req_top.url' is read only.} {
 	sub vcl_recv {
 		set req_top.url = "/foo";
 	}
@@ -37,7 +38,7 @@ server s1 {
 	expect req.http.top-method == "GET"
 	expect req.http.top-proto == "HTTP/1.1"
 	expect req.http.top-foo == "bar"
-	expect req.url == "/b1"
+	expect req.url == "/c2"
 	txresp
 
 	rxreq
@@ -45,7 +46,7 @@ server s1 {
 	expect req.http.top-method == "GET"
 	expect req.http.top-proto == "HTTP/1.1"
 	expect req.http.top-foo == "bar"
-	expect req.url == "/c2"
+	expect req.url == "/b1"
 	txresp
 } -start
 
@@ -71,6 +72,7 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
+	expect resp.bodylen == 81
 } -run
 
 varnish v1 -expect esi_errors == 0
diff --git a/bin/varnishtest/tests/g00002.vtc b/bin/varnishtest/tests/g00002.vtc
index 30b05ad..6afddd8 100644
--- a/bin/varnishtest/tests/g00002.vtc
+++ b/bin/varnishtest/tests/g00002.vtc
@@ -13,6 +13,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-sdefault,2m" \
+	-arg "-p feature=+esi_disable_xml_check" \
 	-cliok "param.set http_gzip_support true" \
 	-cliok "param.set gzip_memlevel 1" \
 	-vcl+backend {
diff --git a/bin/varnishtest/tests/l00003.vtc b/bin/varnishtest/tests/l00003.vtc
index 4bbb04e..af3675e 100644
--- a/bin/varnishtest/tests/l00003.vtc
+++ b/bin/varnishtest/tests/l00003.vtc
@@ -16,7 +16,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url != "/2") {
+			set beresp.do_esi = true;
+		}
 	}
 	sub vcl_deliver {
 		unset resp.http.date;
diff --git a/bin/varnishtest/tests/r00326.vtc b/bin/varnishtest/tests/r00326.vtc
index 00ac603..3a9d389 100644
--- a/bin/varnishtest/tests/r00326.vtc
+++ b/bin/varnishtest/tests/r00326.vtc
@@ -4,7 +4,7 @@ server s1 {
 	rxreq
 	txresp -body {<esi:include src="/foo"/><esi:include src="/foo"/>}
 	rxreq
-	txresp -body "FOO\n"
+	txresp -body "<pre>FOO</pre>\n"
 } -start
 
 varnish v1 -vcl+backend {
@@ -17,5 +17,5 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
-	expect resp.bodylen == 8
+	expect resp.bodylen == 30
 } -run
diff --git a/bin/varnishtest/tests/r00345.vtc b/bin/varnishtest/tests/r00345.vtc
index 9041acd..f87f655 100644
--- a/bin/varnishtest/tests/r00345.vtc
+++ b/bin/varnishtest/tests/r00345.vtc
@@ -4,7 +4,7 @@ barrier b1 cond 2
 
 server s1 {
 	rxreq
-	txresp -body {<esi:include src="someurl">}
+	txresp -body {<esi:include src="someurl"/>}
 	rxreq
 	barrier b1 sync
 	delay 1
diff --git a/bin/varnishtest/tests/r00427.vtc b/bin/varnishtest/tests/r00427.vtc
index c097494..f116c60 100644
--- a/bin/varnishtest/tests/r00427.vtc
+++ b/bin/varnishtest/tests/r00427.vtc
@@ -28,7 +28,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r00445.vtc b/bin/varnishtest/tests/r00445.vtc
index 1d6be3b..3334415 100644
--- a/bin/varnishtest/tests/r00445.vtc
+++ b/bin/varnishtest/tests/r00445.vtc
@@ -3,13 +3,13 @@ varnishtest "zero length ESI include segmens with chunked encoding"
 server s1 {
 	rxreq
 	expect req.url == "/"
-	txresp -body {<foo><esi:include src="/bar"><bar>}
+	txresp -body {<foo><esi:include src="/bar"/><bar>}
 	rxreq
 	expect req.url == "/bar"
 	txresp
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/r00476.vtc b/bin/varnishtest/tests/r00476.vtc
index 9804d2f..41436f8 100644
--- a/bin/varnishtest/tests/r00476.vtc
+++ b/bin/varnishtest/tests/r00476.vtc
@@ -3,7 +3,7 @@ varnishtest "zero length ESI include segments with chunked encoding"
 server s1 {
 	rxreq
 	expect req.url == "/"
-	txresp -body {<a><esi:include src="/bar"><b>\0c}
+	txresp -body {<a><esi:include src="/bar"/><b>\0c}
 	rxreq
 	expect req.url == "/bar"
 	txresp
@@ -12,7 +12,7 @@ server s1 {
 	txresp -body {<a><!--esi foo --><b>\0c}
 	rxreq
 	expect req.url == "/nullbefore"
-	txresp -body {<a>\0<esi:include src="/bar"><b>c}
+	txresp -body {<a>\0<esi:include src="/bar"/><b>c}
 } -start
 
 varnish v1 -vcl+backend {
diff --git a/bin/varnishtest/tests/r00590.vtc b/bin/varnishtest/tests/r00590.vtc
index ce16ba5..ab0bba4 100644
--- a/bin/varnishtest/tests/r00590.vtc
+++ b/bin/varnishtest/tests/r00590.vtc
@@ -61,7 +61,9 @@ varnish v1 -vcl+backend {
 		return (pass);
 	}
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r00612.vtc b/bin/varnishtest/tests/r00612.vtc
index d36e5a0..46ec702 100644
--- a/bin/varnishtest/tests/r00612.vtc
+++ b/bin/varnishtest/tests/r00612.vtc
@@ -32,7 +32,7 @@ server s1 {
 	txresp -body "55555"
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_recv {
 		return (pass);
 	}
diff --git a/bin/varnishtest/tests/r00894.vtc b/bin/varnishtest/tests/r00894.vtc
index 04a793d..4a81523 100644
--- a/bin/varnishtest/tests/r00894.vtc
+++ b/bin/varnishtest/tests/r00894.vtc
@@ -11,8 +11,16 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * * Fetch_Body
+	expect 0 = ESI_xmlerror {^ERR after 5 ESI 1.0 <esi:include> has multiple src= attributes$}
+	expect 0 = BackendReuse
+} -start
+
 client c1 {
 	txreq
 	rxresp
 	expect resp.bodylen == 10
 } -run
+
+logexpect l1 -wait
diff --git a/bin/varnishtest/tests/r00961.vtc b/bin/varnishtest/tests/r00961.vtc
index c6e9209..320dc4f 100644
--- a/bin/varnishtest/tests/r00961.vtc
+++ b/bin/varnishtest/tests/r00961.vtc
@@ -37,7 +37,9 @@ varnish v1 -vcl+backend {
 		return (pass);
 	}
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r01029.vtc b/bin/varnishtest/tests/r01029.vtc
index 7058ef4..23d25a6 100644
--- a/bin/varnishtest/tests/r01029.vtc
+++ b/bin/varnishtest/tests/r01029.vtc
@@ -13,8 +13,8 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
 		if (bereq.url == "/foo") {
+			set beresp.do_esi = true;
 			set beresp.ttl = 0s;
 		} else {
 			set beresp.ttl = 10m;
diff --git a/bin/varnishtest/tests/r01038.vtc b/bin/varnishtest/tests/r01038.vtc
index 705e11c..540deb8 100644
--- a/bin/varnishtest/tests/r01038.vtc
+++ b/bin/varnishtest/tests/r01038.vtc
@@ -47,7 +47,9 @@ server s1 {
 
 varnish v1 -arg "-p workspace_backend=10k" -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url == "/") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
@@ -62,4 +64,3 @@ client c1 {
 } -run
 
 varnish v1 -expect losthdr == 0
-
diff --git a/bin/varnishtest/tests/r01092.vtc b/bin/varnishtest/tests/r01092.vtc
index 7512ea4..a53b7ba 100644
--- a/bin/varnishtest/tests/r01092.vtc
+++ b/bin/varnishtest/tests/r01092.vtc
@@ -24,6 +24,12 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * * Fetch_Body
+	expect 0 * ESI_xmlerror {^ERR after 66 ESI 1.0 Nested <!--esi element in <esi:remove>$}
+	expect 0 = BackendReuse
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -32,3 +38,4 @@ client c1 {
 
 client c1 -run
 varnish v1 -expect esi_errors == 1
+logexpect l1 -wait
diff --git a/bin/varnishtest/tests/r01184.vtc b/bin/varnishtest/tests/r01184.vtc
index 8cfb741..d5aba32 100644
--- a/bin/varnishtest/tests/r01184.vtc
+++ b/bin/varnishtest/tests/r01184.vtc
@@ -33,7 +33,9 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_backend_response {
-		set beresp.do_esi = true;
+		if (bereq.url != "/incl") {
+			set beresp.do_esi = true;
+		}
 	}
 } -start
 
diff --git a/bin/varnishtest/tests/r01355.vtc b/bin/varnishtest/tests/r01355.vtc
index 0aa132b..44b1b39 100644
--- a/bin/varnishtest/tests/r01355.vtc
+++ b/bin/varnishtest/tests/r01355.vtc
@@ -21,6 +21,16 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 -g raw {
+	expect * * Fetch_Body
+	expect 0 = ESI_xmlerror {^No ESI processing, first char not '<' but BOM. .See feature esi_remove_bom.$}
+	expect 0 = BackendReuse
+# XXX another logexpect weirdness - why can't we catch the second occurrence?
+#	expect * * Fetch_Body
+#	expect 0 = ESI_xmlerror {^No ESI processing, first char not '<' but BOM. .See feature esi_remove_bom.$}
+#	expect 0 = BackendReuse
+} -start
+
 client c1 {
 	# No ESI processing
 	txreq -url /1
@@ -28,6 +38,8 @@ client c1 {
 	expect resp.bodylen == 47
 } -run
 
+logexpect l1 -wait
+
 varnish v1 -cliok "param.set feature +esi_remove_bom"
 
 client c1 {
diff --git a/bin/varnishtest/tests/r01641.vtc b/bin/varnishtest/tests/r01641.vtc
index 1dddc85..0fb5f7b 100644
--- a/bin/varnishtest/tests/r01641.vtc
+++ b/bin/varnishtest/tests/r01641.vtc
@@ -13,7 +13,7 @@ server s2 {
 server s1 -start
 server s2 -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_recv {
 		return (pass);
 	}
diff --git a/bin/varnishtest/tests/r01737.vtc b/bin/varnishtest/tests/r01737.vtc
index 182d1f0..845b1de 100644
--- a/bin/varnishtest/tests/r01737.vtc
+++ b/bin/varnishtest/tests/r01737.vtc
@@ -23,7 +23,7 @@ server s1 {
 	rxresp
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/r01781.vtc b/bin/varnishtest/tests/r01781.vtc
index 174f82f..4801d06 100644
--- a/bin/varnishtest/tests/r01781.vtc
+++ b/bin/varnishtest/tests/r01781.vtc
@@ -13,7 +13,7 @@ server s1 {
 	txresp -body {Foo}
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_gzip = true;
 		set beresp.do_esi = true;
diff --git a/bin/varnishtest/tests/r01941.vtc b/bin/varnishtest/tests/r01941.vtc
index 79f21c9..2561bf1 100644
--- a/bin/varnishtest/tests/r01941.vtc
+++ b/bin/varnishtest/tests/r01941.vtc
@@ -1,4 +1,3 @@
-
 varnishtest "ESI memory should only be fully allocated"
 
 # In this test case, the cache is almost filled. Then we force the
@@ -24,6 +23,7 @@ server s1 {
 } -start
 
 varnish v1 -arg "-pfetch_chunksize=4k" \
+	-arg "-p feature=+esi_disable_xml_check" \
 	-arg "-sdefault,1m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;


More information about the varnish-commit mailing list