]> err.no Git - varnish/commitdiff
Add testcase for cli:purge
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 13 Jan 2009 14:18:54 +0000 (14:18 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 13 Jan 2009 14:18:54 +0000 (14:18 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3511 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

diff --git a/varnish-cache/bin/varnishtest/tests/c00021.vtc b/varnish-cache/bin/varnishtest/tests/c00021.vtc
new file mode 100644 (file)
index 0000000..a222c87
--- /dev/null
@@ -0,0 +1,41 @@
+# $Id: c00006.vtc 2906 2008-07-08 10:29:07Z phk $
+
+test "Test banning a url with cli:purge"
+
+server s1 {
+       rxreq
+       expect req.url == "/foo"
+       txresp -body "1111\n"
+       rxreq
+       expect req.url == "/foo"
+       txresp -body "11111\n"
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+       txreq -url "/foo"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.content-length == 5
+} 
+
+client c1 -run
+
+varnish v1 -clierr 104 "purge"
+varnish v1 -clierr 104 "purge foo"
+varnish v1 -clierr 104 "purge foo bar"
+varnish v1 -clierr 106 "purge a b c && a"
+varnish v1 -clierr 106 "purge a b c && a b"
+varnish v1 -clierr 106 "purge a b c || a b c"
+varnish v1 -cli "purge req.url ~ foo"
+# varnish v1 -cli "purge req.url ~ foo && req.url ~ bar"
+
+client c1 {
+       txreq -url "/foo"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.content-length == 6
+}
+
+client c1 -run