~ubuntu-branches/ubuntu/lucid/varnish/lucid-updates

« back to all changes in this revision

Viewing changes to bin/varnishtest/tests/r00444.vtc

  • Committer: Bazaar Package Importer
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2010-03-24 13:26:08 UTC
  • mfrom: (0.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100324132608-4uzkavctn26bdwyi
Tags: 2.1.0-1
* New upstream version
* Fix small error in man/vcl.7so

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: r00444.vtc 4612 2010-03-16 09:10:19Z phk $
 
2
 
 
3
test "purging on POST"
 
4
 
 
5
server s1 {
 
6
        rxreq
 
7
        expect req.request == "GET"
 
8
        txresp -body "1"
 
9
 
 
10
        rxreq
 
11
        expect req.request == "POST"
 
12
        txresp -body "22"
 
13
 
 
14
        rxreq
 
15
        expect req.request == "POST"
 
16
        txresp -body "333"
 
17
 
 
18
        rxreq
 
19
        expect req.request == "GET"
 
20
        txresp -body "4444"
 
21
} -start
 
22
 
 
23
varnish v1 -vcl+backend {
 
24
        sub vcl_recv {
 
25
                if (req.request == "POST") {
 
26
                        /* Lookup so we find any cached object */
 
27
                        return (lookup);
 
28
                }
 
29
        }
 
30
        sub vcl_hit {
 
31
                if (req.request == "POST") {
 
32
                        /* Get rid of this object */
 
33
                        set obj.cacheable = false;
 
34
                        set obj.ttl = 0s;
 
35
                        return (pass);
 
36
                }
 
37
        }
 
38
        sub vcl_miss {
 
39
                if (req.request == "POST") {
 
40
                        /* Make sure we don't cache the POST result */
 
41
                        return (pass);
 
42
                }
 
43
        }
 
44
} -start
 
45
 
 
46
client c1 {
 
47
        txreq
 
48
        rxresp
 
49
        expect resp.bodylen == 1
 
50
 
 
51
        txreq -req POST
 
52
        rxresp
 
53
        expect resp.bodylen == 2
 
54
 
 
55
        txreq -req POST
 
56
        rxresp
 
57
        expect resp.bodylen == 3
 
58
 
 
59
        txreq
 
60
        rxresp
 
61
        expect resp.bodylen == 4
 
62
} -run