r5104 - in trunk/varnish-cache/bin/varnishtest: . tests
phk at varnish-cache.org
phk at varnish-cache.org
Fri Aug 13 12:39:40 CEST 2010
Author: phk
Date: 2010-08-13 12:39:40 +0200 (Fri, 13 Aug 2010)
New Revision: 5104
Added:
trunk/varnish-cache/bin/varnishtest/tests/c00036.vtc
Modified:
trunk/varnish-cache/bin/varnishtest/t001.vtc
Log:
Add a testcase for backend retries.
Modified: trunk/varnish-cache/bin/varnishtest/t001.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/t001.vtc 2010-08-13 10:19:40 UTC (rev 5103)
+++ trunk/varnish-cache/bin/varnishtest/t001.vtc 2010-08-13 10:39:40 UTC (rev 5104)
@@ -4,33 +4,28 @@
server s1 -repeat 1 {
rxreq
- txresp \
- -hdr "Connection: close" \
- -hdr "Test1: foobar" \
- -hdr "Test2: foobar" \
- -body "012345\n"
-}
+ txresp -bodylen 5
+ rxreq
+ accept
+ rxreq
+ txresp -bodylen 6
+} -start
-varnish v1 -launch
-
varnish v1 -vcl+backend {
sub vcl_recv {
- pipe;
+ return(pass);
}
-}
+} -start
-varnish v1 -start
-
-server s1 -start
-
client c1 {
- txreq -url "/"
+ txreq
rxresp
expect resp.status == 200
-}
+ expect resp.bodylen == 5
+ txreq
+ rxresp
+ expect resp.status == 200
+ expect resp.bodylen == 6
+} -run
-client c1 -run
-
-# server s1 -wait
-
-# varnish v1 -wait
+varnish v1 -expect backend_retry == 1
Added: trunk/varnish-cache/bin/varnishtest/tests/c00036.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00036.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00036.vtc 2010-08-13 10:39:40 UTC (rev 5104)
@@ -0,0 +1,35 @@
+# $Id$
+
+test "Backend close retry"
+
+server s1 -repeat 1 {
+ rxreq
+ txresp -bodylen 5
+
+ rxreq
+ accept
+
+ rxreq
+ txresp -bodylen 6
+
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_recv {
+ return(pass);
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+ expect resp.bodylen == 5
+
+ txreq
+ rxresp
+ expect resp.status == 200
+ expect resp.bodylen == 6
+} -run
+
+varnish v1 -expect backend_retry == 1
More information about the varnish-commit
mailing list