~ubuntu-branches/debian/sid/varnish/sid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-29 15:23:24 UTC
  • mfrom: (0.1.15)
  • Revision ID: package-import@ubuntu.com-20111029152324-tdtlsurrv22ysknj
Tags: 3.0.2-1
* New upstream release
* Build from upstream tarball instead of git tag
* debian/watch: more specific regular expression

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
varnishtest "Test ban_lurker_sleep vs failed ban lurker"
 
2
 
 
3
# The idea here is that the ban lurker should always wait 1 second when it
 
4
# can't proceed, as per documentation and original intent. The
 
5
# ban_lurker_sleep should not affect sleep-times when the lurker fails.
 
6
 
 
7
server s1 {
 
8
        rxreq
 
9
        txresp -status 200
 
10
 
 
11
        rxreq
 
12
        txresp -status 200
 
13
} -start
 
14
 
 
15
varnish v1 -vcl+backend {
 
16
        sub vcl_recv {
 
17
                if (req.request == "BAN") {
 
18
                        ban("obj.http.url ~ /");
 
19
                        error 201 "banned";
 
20
                }
 
21
                return (lookup);
 
22
        }
 
23
        sub vcl_fetch {
 
24
                set beresp.http.url = req.url;
 
25
        }
 
26
} -start
 
27
 
 
28
varnish v1 -cliok "param.set ban_lurker_sleep 0.01"
 
29
varnish v1 -expect n_ban_obj_test == 0
 
30
 
 
31
delay 0.01
 
32
client c1 {
 
33
        txreq -req GET
 
34
        rxresp
 
35
        expect resp.status == 200
 
36
 
 
37
        txreq -req BAN
 
38
        rxresp
 
39
        expect resp.status == 201
 
40
} -run
 
41
 
 
42
delay 0.1
 
43
varnish v1 -expect n_ban_obj_test == 0
 
44
 
 
45
delay 1.0
 
46
varnish v1 -expect n_ban_obj_test == 1
 
47
 
 
48
varnish v1 -cliok "param.set ban_lurker_sleep 5.01"
 
49
 
 
50
client c2 {
 
51
        txreq -req GET
 
52
        rxresp
 
53
        expect resp.status == 200
 
54
 
 
55
        txreq -req BAN
 
56
        rxresp
 
57
        expect resp.status == 201
 
58
} -run
 
59
 
 
60
delay 0.1
 
61
varnish v1 -expect n_ban_obj_test == 1
 
62
 
 
63
delay 1.1
 
64
varnish v1 -expect n_ban_obj_test == 2