]> err.no Git - varnish/commitdiff
Add testcase for VCL/VRT obj.ttl and obj.grace
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Jun 2008 10:15:55 +0000 (10:15 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Jun 2008 10:15:55 +0000 (10:15 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2844 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

index 0e6a110fb2e92bef53d38c6a8b95b424b6c9a1b5..8b2ec1570ab85c1b6d606e102c2abf2a9042ef9e 100644 (file)
@@ -21,3 +21,4 @@ Naming scheme
        id ~ [e] --> ESI tests
        id ~ [r] --> Regression tests, same number as ticket
        id ~ [s] --> Slow tests, expiry, grace etc.
+       id ~ [v] --> VCL tests: execute VRT functions
diff --git a/varnish-cache/bin/varnishtest/tests/v00000.vtc b/varnish-cache/bin/varnishtest/tests/v00000.vtc
new file mode 100644 (file)
index 0000000..463d1bd
--- /dev/null
@@ -0,0 +1,30 @@
+# $Id$
+
+test "VCL/VRT: obj.ttl and obj.grace"
+
+
+server s1 {
+       rxreq 
+       txresp -hdr "Connection: close" -body "012345\n"
+}
+
+server s1 -start 
+
+varnish v1 -vcl+backend {
+       sub vcl_fetch {
+               set obj.ttl += 1 m;
+               set obj.grace += 1 m;
+       }
+} -start
+
+client c1 {
+       txreq -url "/"
+       rxresp
+       expect resp.status == 200
+}
+
+client c1 -run
+
+server s1 -wait
+
+varnish v1 -stop