]> err.no Git - varnish/commitdiff
Two slow testcases to test object expiry
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 12:32:06 +0000 (12:32 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 12:32:06 +0000 (12:32 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2834 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/README
varnish-cache/bin/varnishtest/tests/s00000.vtc [new file with mode: 0644]
varnish-cache/bin/varnishtest/tests/s00001.vtc [new file with mode: 0644]

index c318a1b5fc466fdc9da148ac9131a74e027985d9..0e6a110fb2e92bef53d38c6a8b95b424b6c9a1b5 100644 (file)
@@ -19,5 +19,5 @@ Naming scheme
        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.
diff --git a/varnish-cache/bin/varnishtest/tests/s00000.vtc b/varnish-cache/bin/varnishtest/tests/s00000.vtc
new file mode 100644 (file)
index 0000000..a0184ce
--- /dev/null
@@ -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
diff --git a/varnish-cache/bin/varnishtest/tests/s00001.vtc b/varnish-cache/bin/varnishtest/tests/s00001.vtc
new file mode 100644 (file)
index 0000000..f352f5e
--- /dev/null
@@ -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