~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002110912

« back to all changes in this revision

Viewing changes to libsieve/tests/control-structures.svtest

  • Committer: Chuck Short
  • Date: 2010-01-21 20:21:25 UTC
  • mfrom: (4.1.11 squeeze)
  • Revision ID: zulcss@ubuntu.com-20100121202125-pme73o491kfwj5nc
* Merge from debian testing, remaining changes:
  + Add new binary pkg dovecot-postfix that integrates postfix and dovecot
    automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restriction
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
  + debian/dovecot-postfix.dirs: create backup directory for postfix's config
    configuration
  + restart postfix and dovecot.
  + debian/dovecot-postfix.postrm:
    - remove all dovecot related configuration from postfix.
    - restart postfix and dovecot.
  + debian/dovecot-common.init:
    - check if /etc/dovecot/dovecot-postfix.conf exists and use it
      as the configuration file if so.
  + debian/patches/warning-ubuntu-postfix.dpatch
    - add warning about dovecot-postfix.conf in dovecot default
      configuration file
  + debian/patches/dovecot-postfix.conf.diff:
    - Ubuntu server custom changes to the default dovecot configuration for
      better interfation with postfix.
    - enable sieve plugin.
    - Ubuntu server custom changes to the default dovecot configuration for
      better integration with postfix:
      - enable imap, pop3, imaps, pop3s and managesieve by default.
      - enable dovecot LDA (deliver).
      - enable SASL auth socket in postfix private directory
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules: install profile.
     - debian/control: suggest ufw.
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). (LP: #254721)
   + debian/control: Update Vcs-* headers.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
* New upstream release.
* debian/patches/gold-fix.patch: Removed. Fixed upstream.
* Moved libexec to lib corrections in dovecot-managesieve.patch and
  dovecot-managesieve-dist.patch to dovecot-example.patch
* debian/patches/dovecot-mboxlocking.patch: Regenerated to avoid FTBFS
  when quilt isn't installed.
* debian/patches/quota-mountpoint.patch: Removed. Not needed anymore.
* debian/patches/dovecot-quota.patch: Removed. Quotas aren't properly
  enabled unless mail_plugins = quota imap_quota.
* debian/patches/gold-fix.patch: Fixed configure script to build even
  with binutils-gold or --no-add-needed linker flag (Closes: #554306)
* debian/dovecot-common.init: fixed LSB headers. Thanks to Pascal Volk.
  (Closes: #558040)
* debian/changelog: added CVE references to previous changelog entry.
* debian/rules: checked up the build system. It's not fragile anymore.
  (Closes: 493803)
* debian/dovecot-common.postinst: Now invoking dpkg-reconfigure
  on dovecot-common is enough to generate new certificates
  if the previous ones were removed. (Closes: #545582)
* debian/rules: No longer install convert-tool in /usr/bin.
  It isn't an user utility and it should stay in /usr/lib/dovecot
  like all other similar tool.
* New upstream release. (Closes: #557601)
* [SECURITY] Fixes local information disclosure and denial of service.
  (see: http://www.dovecot.org/list/dovecot-news/2009-November/000143.html
  and CVE-2009-3897)
* Added myself to uploaders.
* Switched to the new source format "3.0 (quilt)":
  - removed dpatch from build-depends
  - removed debian/README.source because now we use only standard
    dpkg features
  - regenerated all patches
* Prepared to switch to multi-origin source:
  - recreated dovecot-libsieve.patch and dovecot-managesieve-dist.patch
    starting from the upstream tarball
  - removed all autotools related build-depends and build-conflict
  - renamed dovecot-libsieve and dovecot-managesieve directories
    to libsieve and managesieve.
* debian/rules: Moved the configuration of libsieve and managesieve from
  the build phase to the configuration phase
* Added dovecot-dbg package  with debugging symbols.  Thanks Stephan Bosch.
  (Closes: #554710)
* Fixed some stray libexec'isms in the default configuration.
* New upstream release.
* debian/dovecot-common.init:
  - use $CONF when starting the daemon. (Closes: #549944)
  - always output start/stop messages. (Closes: #523810)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require "vnd.dovecot.testsuite";
 
2
 
 
3
test_set "message" text:
 
4
From: stephan@rename-it.nl
 
5
To: test@dovecot.org
 
6
Subject: Test
 
7
 
 
8
Test!
 
9
.
 
10
;
 
11
 
 
12
test "IF-true" {
 
13
        if true {
 
14
        } else {
 
15
                test_fail "executed wrong alternative";
 
16
        }
 
17
}
 
18
 
 
19
test "IF-false" {
 
20
        if false {
 
21
                test_fail "executed wrong alternative";
 
22
        }
 
23
}
 
24
 
 
25
test "ELSEIF-true" {
 
26
        if false {
 
27
                test_fail "executed wrong alternative (if)";
 
28
        } elsif true {
 
29
        } else {
 
30
                test_fail "executed wrong alternative (else)";  
 
31
        }
 
32
}
 
33
 
 
34
test "ELSEIF-false" {
 
35
        if false {
 
36
                test_fail "executed wrong alternative (if)";
 
37
        } elsif false {
 
38
                test_fail "executed wrong alternative (elsif)"; 
 
39
        } else {
 
40
        }
 
41
}
 
42
 
 
43
test "IF-address-true" {
 
44
        if address :is "from" "stephan@rename-it.nl" {
 
45
        } else {
 
46
                test_fail "executed wrong alternative";
 
47
        }
 
48
}
 
49
 
 
50
test "IF-address-false" {
 
51
        if address :is "from" "tss@iki.fi" {
 
52
                test_fail "executed wrong alternative";
 
53
        }
 
54
}
 
55
 
 
56
test "ELSEIF-address-true" {
 
57
        if address :is "from" "tss@iki.fi" {
 
58
                test_fail "executed wrong alternative (if)";
 
59
        } elsif address :is "from" "stephan@rename-it.nl" {
 
60
        } else {
 
61
                test_fail "executed wrong alternative (else)";  
 
62
        }
 
63
}
 
64
 
 
65
test "ELSEIF-address-false" {
 
66
        if address :is "from" "tss@iki.fi" {
 
67
                test_fail "executed wrong alternative (if)";
 
68
        } elsif address :is "to" "stephan@rename-it.nl" {
 
69
                test_fail "executed wrong alternative (elsif)"; 
 
70
        } else {
 
71
        }
 
72
}
 
73
 
 
74
test "IF-nesting-static" {
 
75
        if true {
 
76
                if true {
 
77
                        if false {
 
78
                                test_fail "chose wrong outcome: true->true->false";
 
79
                        } else {
 
80
                        }
 
81
                } else {
 
82
                        test_fail "chose wrong outcome: true->false";
 
83
                }
 
84
        } elsif true {
 
85
                if false {
 
86
                        test_fail "chose wrong outcome: false->true->false";    
 
87
                } elsif true {
 
88
                        test_fail "chose wrong outcome: false->true->true";
 
89
                }
 
90
        } else {
 
91
                test_fail "chose wrong outcome: false->false";
 
92
        }
 
93
}
 
94
 
 
95
test "ALLOF-ANYOF-static" {
 
96
        if allof ( true, true, true, true, anyof (false, false, true, false) ) {
 
97
                if anyof( allof(false, false), allof(false, true), allof(true, false) ) {
 
98
                        test_fail "chose wrong outcome: true->true";
 
99
                } elsif allof( anyof(false, true), true, anyof(true, false), anyof(true, true)) {
 
100
                        
 
101
                } else {
 
102
                        test_fail "chose wrong outcome: true->false->false";                    
 
103
                }
 
104
        } else {
 
105
                test_fail "chose wrong outcome: false";
 
106
        }
 
107
}
 
108
 
 
109
test "ALLOF-ANYOF-single" {
 
110
        # Static 
 
111
        if not allof ( true ) {
 
112
                test_fail "allof ( true ) evaluates to false";
 
113
        }
 
114
 
 
115
        if allof ( false ) {
 
116
                test_fail "allof ( false ) evaluates to true";
 
117
        }
 
118
 
 
119
        if not anyof ( true ) {
 
120
                test_fail "anyof ( true ) evaluates to false";
 
121
        }
 
122
 
 
123
        if anyof ( false ) {
 
124
                test_fail "anyof ( false ) evaluates to true";
 
125
        }       
 
126
 
 
127
        # Dynamic
 
128
        if not allof ( exists "subject" ) {
 
129
        test_fail "allof ( 'true' ) evaluates to false";
 
130
    }
 
131
 
 
132
    if allof ( exists "x-nonsense" ) {
 
133
        test_fail "allof ( 'false' ) evaluates to true";
 
134
    }
 
135
 
 
136
    if not anyof ( exists "subject" ) {
 
137
        test_fail "anyof ( 'true' ) evaluates to false";
 
138
    }
 
139
 
 
140
    if anyof ( exists "x-nonsense" ) {
 
141
        test_fail "anyof ( 'false' ) evaluates to true";
 
142
    }
 
143
}
 
144
 
 
145
test "STOP" {
 
146
        stop;
 
147
        test_fail "continued after stop";
 
148
}
 
149