[master] 9e7c2d4 Test stevedore/LRU/Nuke when the body allocation fails

Poul-Henning Kamp phk at varnish-cache.org
Mon Aug 22 13:44:01 CEST 2011


commit 9e7c2d4bc16a06a4d94df831bad2c1ee7eb89c45
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 22 11:43:26 2011 +0000

    Test stevedore/LRU/Nuke when the body allocation fails

diff --git a/bin/varnishtest/tests/c00046.vtc b/bin/varnishtest/tests/c00046.vtc
new file mode 100644
index 0000000..0719df3
--- /dev/null
+++ b/bin/varnishtest/tests/c00046.vtc
@@ -0,0 +1,64 @@
+varnishtest	"Object/LRU/Stevedores with hinting and body alloc failures"
+
+server s1 {
+	rxreq
+	txresp -bodylen 1000000
+	rxreq
+	txresp -bodylen 1000001
+	rxreq
+	txresp -bodylen 1000002
+} -start
+
+varnish v1 -storage "-smalloc,1m -smalloc,1m, -smalloc,1m" -vcl+backend {
+	sub vcl_fetch {
+		set beresp.storage = "s0";
+	}
+} -start
+
+
+client c1 {
+	txreq -url /foo
+	rxresp
+	expect resp.status == 200
+	expect resp.bodylen == 1000000
+} -run
+
+varnish v1 -expect SMA.Transient.g_bytes == 0
+varnish v1 -expect SMA.s0.g_bytes > 1000000
+varnish v1 -expect SMA.s0.g_space < 100000
+varnish v1 -expect SMA.s1.g_bytes == 0
+varnish v1 -expect SMA.s1.g_space > 1000000
+varnish v1 -expect SMA.s2.g_bytes == 0
+varnish v1 -expect SMA.s2.g_space > 1000000 
+
+client c1 {
+	txreq -url /bar
+	rxresp
+	expect resp.status == 200
+	expect resp.bodylen == 1000001
+} -run
+
+varnish v1 -expect n_lru_nuked == 1
+varnish v1 -expect SMA.Transient.g_bytes == 0
+varnish v1 -expect SMA.s0.g_bytes > 1000000
+varnish v1 -expect SMA.s0.g_space < 100000
+varnish v1 -expect SMA.s1.g_bytes == 0
+varnish v1 -expect SMA.s1.g_space > 1000000
+varnish v1 -expect SMA.s2.g_bytes == 0
+varnish v1 -expect SMA.s2.g_space > 1000000 
+
+client c1 {
+	txreq -url /foo
+	rxresp
+	expect resp.status == 200
+	expect resp.bodylen == 1000002
+} -run
+
+varnish v1 -expect n_lru_nuked == 2
+varnish v1 -expect SMA.Transient.g_bytes == 0
+varnish v1 -expect SMA.s0.g_bytes > 1000000
+varnish v1 -expect SMA.s0.g_space < 100000
+varnish v1 -expect SMA.s1.g_bytes == 0
+varnish v1 -expect SMA.s1.g_space > 1000000
+varnish v1 -expect SMA.s2.g_bytes == 0
+varnish v1 -expect SMA.s2.g_space > 1000000 



More information about the varnish-commit mailing list