[master] dd54061 Test corner-cases with an object containing only an <esi:include> with/without leading and training verbatim data.

Poul-Henning Kamp phk at varnish-cache.org
Wed Feb 16 07:28:00 CET 2011


commit dd54061d7cab2ae7bc925a47efc9a87c4f7718cb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 15 21:37:04 2011 +0000

    Test corner-cases with an object containing only an <esi:include>
    with/without leading and training verbatim data.

diff --git a/bin/varnishtest/tests/e00026.vtc b/bin/varnishtest/tests/e00026.vtc
new file mode 100644
index 0000000..dd58f78
--- /dev/null
+++ b/bin/varnishtest/tests/e00026.vtc
@@ -0,0 +1,82 @@
+# $Id$
+
+test "Test esi-include + gzip edgecase with respect to gzip hdr"
+
+server s1 {
+	rxreq
+	expect req.url == "/foo"
+	txresp -gzipbody {<h1>/////<h2>}
+
+	rxreq 
+	expect req.url == "/1"
+	expect req.http.accept-encoding == gzip
+	txresp -gzipbody {B<esi:include src="/foo"/>A}
+
+	rxreq 
+	expect req.url == "/2"
+	expect req.http.accept-encoding == gzip
+	txresp -gzipbody {B<esi:include src="/foo"/>}
+
+	rxreq 
+	expect req.url == "/3"
+	expect req.http.accept-encoding == gzip
+	txresp -gzipbody {<esi:include src="/foo"/>A}
+
+	rxreq 
+	expect req.url == "/4"
+	expect req.http.accept-encoding == gzip
+	txresp -gzipbody {<esi:include src="/foo"/>}
+
+} -start
+
+varnish v1 -vcl+backend {
+	sub vcl_fetch {
+		if (req.url != "/foo") {
+			set beresp.do_esi = true;
+		}
+	}
+} -start 
+
+varnish v1 -cliok "param.set esi_syntax 0x21" 
+
+varnish v1 -cliok "param.set diag_bitmap 0x10000"
+
+client c1 {
+	txreq -url /foo -hdr "Accept-Encoding: gzip"
+	rxresp
+	gunzip
+	expect resp.status == 200
+	expect resp.bodylen == 13
+
+	txreq -url /1 -hdr "Accept-Encoding: gzip"
+	rxresp
+	expect resp.http.content-encoding == gzip
+	gunzip
+	expect resp.status == 200
+	expect resp.bodylen == 15
+
+	txreq -url /2 -hdr "Accept-Encoding: gzip"
+	rxresp
+	expect resp.http.content-encoding == gzip
+	gunzip
+	expect resp.status == 200
+	expect resp.bodylen == 14
+
+	txreq -url /3 -hdr "Accept-Encoding: gzip"
+	rxresp
+	expect resp.http.content-encoding == gzip
+	gunzip
+	expect resp.status == 200
+	expect resp.bodylen == 14
+
+	txreq -url /4 -hdr "Accept-Encoding: gzip"
+	rxresp
+	expect resp.http.content-encoding == gzip
+	gunzip
+	expect resp.status == 200
+	expect resp.bodylen == 13
+
+}
+
+client c1 -run
+varnish v1 -expect esi_errors == 0



More information about the varnish-commit mailing list