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

« back to all changes in this revision

Viewing changes to bin/varnishtest/tests/v00016.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: v00016.vtc 3602 2009-02-05 10:29:18Z tfheen $
 
1
# $Id: v00016.vtc 4612 2010-03-16 09:10:19Z phk $
2
2
 
3
3
test "Various VCL compiler coverage tests"
4
4
 
5
 
shell "true > /tmp/_varnishtest_empty_file"
 
5
shell "true > ${tmpdir}/_varnishtest_empty_file"
6
6
 
7
7
varnish v1 -vcl {
8
8
        backend b { .host = "127.0.0.1"; }
9
 
        include "/tmp/_varnishtest_empty_file" ;
 
9
        include "${tmpdir}/_varnishtest_empty_file" ;
10
10
}
11
11
 
12
12
varnish v1 -badvcl {
13
13
        backend b { .host = "127.0.0.1"; }
14
 
        include "/tmp/_varnishtest_empty_file" |
 
14
        include "${tmpdir}/_varnishtest_empty_file" |
15
15
}
16
16
 
17
 
shell "rm -f /tmp/_varnishtest_empty_file"
 
17
shell "rm -f ${tmpdir}/_varnishtest_empty_file"
18
18
 
19
19
varnish v1 -badvcl {
20
20
        backend b { .host = "127.0.0.1"; }
47
47
        /* Test string regexp matching and "else if" */
48
48
        sub vcl_recv {
49
49
                if ((req.url ~ "foobar")) {
50
 
                        pass;
 
50
                        return(pass);
51
51
                } else if (req.url ~ "snafu") {
52
 
                        pipe;
 
52
                        return(pipe);
53
53
                } else {
54
 
                        pass;
 
54
                        return(pass);
55
55
                }
56
56
        }
57
57
}
63
63
 
64
64
        /* test time and backend comparison */
65
65
        sub vcl_fetch {
66
 
                if (obj.ttl > 1d) {
67
 
                        set obj.ttl = 1d;
 
66
                if (beresp.ttl > 1d) {
 
67
                        set beresp.ttl = 1d;
68
68
                }
69
69
                if (req.backend == b) {
70
 
                        set obj.ttl = 1d;
 
70
                        set beresp.ttl = 1d;
71
71
                } else if (req.backend != b) {
72
 
                        set obj.ttl = 1h;
 
72
                        set beresp.ttl = 1h;
73
73
                }
74
74
        }
75
75