r5412 - trunk/varnish-cache/bin/varnishtest/tests

phk at varnish-cache.org phk at varnish-cache.org
Tue Oct 5 21:34:46 CEST 2010


Author: phk
Date: 2010-10-05 21:34:46 +0200 (Tue, 05 Oct 2010)
New Revision: 5412

Modified:
   trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc
Log:
Rewrite this test to use semaphores instead of delays to make it more
robust.



Modified: trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc	2010-10-05 19:33:34 UTC (rev 5411)
+++ trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc	2010-10-05 19:34:46 UTC (rev 5412)
@@ -2,10 +2,38 @@
 
 test "Check grace with sick backends"
 
-server s1 -repeat 4 {
+server s1 {
 	rxreq
 	expect req.url == "/"
-	txresp -body "hi"
+	txresp -proto HTTP/1.0 -hdr "nbr: 1" -body "hi"
+
+	accept
+
+	rxreq
+	expect req.url == "/"
+	txresp -proto HTTP/1.0 -hdr "nbr: 2" -body "hi"
+
+	sema r1 sync 2
+	accept
+
+	rxreq
+	expect req.url == "/"
+	txresp -proto HTTP/1.0 -hdr "nbr: 3" -hdr "foo: bar" -body "hi"
+
+	accept
+	rxreq
+	expect req.url == "/"
+	txresp -proto HTTP/1.0 -status 400 -hdr "nbr: 4" -body "hi"
+	accept
+
+	accept
+	rxreq
+	expect req.url == "/"
+	txresp -proto HTTP/1.0 -status 400 -hdr "nbr: 5" -body "hi"
+	accept
+
+	sema r1 sync 2
+
 } -start
 
 varnish v1 -vcl {
@@ -28,18 +56,20 @@
 	}
 } -start
 
-delay 2
 
 client c1 {
+	sema r1 sync 2
 	txreq -url "/"
 	rxresp
+	expect resp.http.foo == "bar"
 	expect resp.status == 200
 } -run
 
-delay 3
-
 client c2 {
+	sema r1 sync 2
 	txreq -url "/"
 	rxresp
+	expect resp.http.foo == "bar"
 	expect resp.status == 200
+	expect resp.http.x-varnish == "1002 1001"
 } -run




More information about the varnish-commit mailing list