r2834 - trunk/varnish-cache/bin/varnishtest/tests
phk at projects.linpro.no
phk at projects.linpro.no
Thu Jun 26 14:32:06 CEST 2008
Author: phk
Date: 2008-06-26 14:32:06 +0200 (Thu, 26 Jun 2008)
New Revision: 2834
Added:
trunk/varnish-cache/bin/varnishtest/tests/s00000.vtc
trunk/varnish-cache/bin/varnishtest/tests/s00001.vtc
Modified:
trunk/varnish-cache/bin/varnishtest/tests/README
Log:
Two slow testcases to test object expiry
Modified: trunk/varnish-cache/bin/varnishtest/tests/README
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/README 2008-06-26 12:12:29 UTC (rev 2833)
+++ trunk/varnish-cache/bin/varnishtest/tests/README 2008-06-26 12:32:06 UTC (rev 2834)
@@ -19,5 +19,5 @@
id ~ [b] --> Basic functionality tests
id ~ [c] --> Complex functionality tests
id ~ [e] --> ESI tests
- id ~ [r] --> Regression tests.
- id ~ [t] --> Ticket regression tests, number same as ticket.
+ id ~ [r] --> Regression tests, same number as ticket
+ id ~ [s] --> Slow tests, expiry, grace etc.
Added: trunk/varnish-cache/bin/varnishtest/tests/s00000.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/s00000.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/s00000.vtc 2008-06-26 12:32:06 UTC (rev 2834)
@@ -0,0 +1,33 @@
+# $Id$
+
+test "Simple expiry test"
+
+server s1 {
+ rxreq
+ expect req.url == "/"
+ txresp -hdr "Cache-control: max-age = 1" -body "1111\n"
+ delay 3
+ rxreq
+ expect req.url == "/"
+ txresp -hdr "Cache-control: max-age = 1" -body "22222\n"
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+ txreq -url "/"
+ rxresp
+ expect resp.http.content-length == 5
+ expect resp.http.x-varnish == "1001"
+ expect resp.status == 200
+} -run
+
+delay 3
+
+client c2 {
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.x-varnish == "1002"
+ expect resp.http.content-length == 6
+} -run
Added: trunk/varnish-cache/bin/varnishtest/tests/s00001.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/s00001.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/s00001.vtc 2008-06-26 12:32:06 UTC (rev 2834)
@@ -0,0 +1,33 @@
+# $Id$
+
+test "Simple expiry test (fully reaped object)"
+
+server s1 {
+ rxreq
+ expect req.url == "/"
+ txresp -hdr "Cache-control: max-age = 1" -body "1111\n"
+ delay 20
+ rxreq
+ expect req.url == "/"
+ txresp -hdr "Cache-control: max-age = 1" -body "22222\n"
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+ txreq -url "/"
+ rxresp
+ expect resp.http.content-length == 5
+ expect resp.http.x-varnish == "1001"
+ expect resp.status == 200
+} -run
+
+delay 20
+
+client c2 {
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.x-varnish == "1002"
+ expect resp.http.content-length == 6
+} -run
More information about the varnish-commit
mailing list