~ubuntu-branches/ubuntu/quantal/dovecot/quantal-updates

« back to all changes in this revision

Viewing changes to pigeonhole/tests/extensions/editheader/alternating.svtest

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require "vnd.dovecot.testsuite";
 
2
require "variables";
 
3
require "fileinto";
 
4
require "mailbox";
 
5
require "body";
 
6
 
 
7
require "editheader";
 
8
 
 
9
set "message" text:
 
10
From: stephan@example.com
 
11
To: timo@example.com
 
12
Subject: Frop!
 
13
 
 
14
Frop!
 
15
 
 
16
.
 
17
;
 
18
 
 
19
 
 
20
test_set "message" "${message}";
 
21
test "Alternating - add; delete" {
 
22
        addheader "X-Some-Header" "Header content";
 
23
 
 
24
        if not exists "x-some-header" {
 
25
                test_fail "header not added";
 
26
        }
 
27
 
 
28
        if not header :is "x-some-header" "Header content" {
 
29
                test_fail "wrong content added";
 
30
        }
 
31
 
 
32
        redirect "frop@example.com";
 
33
 
 
34
        deleteheader "X-Some-Header";
 
35
 
 
36
        if exists "x-some-header" {
 
37
                test_fail "header not deleted";
 
38
        }
 
39
 
 
40
        fileinto :create "folder1";
 
41
 
 
42
        if not test_result_execute {
 
43
                test_fail "failed to execute result";
 
44
        }
 
45
 
 
46
        /* redirected message */
 
47
 
 
48
        if not test_message :smtp 0 {
 
49
                test_fail "message not redirected";
 
50
        }
 
51
 
 
52
        if not exists "x-some-header" {
 
53
                test_fail "added header not in redirected mail";
 
54
        }
 
55
 
 
56
        if not header :is "x-some-header" "Header content" {
 
57
                test_fail "wrong content in redirected mail ";
 
58
        }
 
59
        
 
60
        /* stored message message */
 
61
 
 
62
        if not test_message :folder "folder1" 0 {
 
63
                test_fail "message not stored";
 
64
        }
 
65
 
 
66
        if exists "x-some-header" {
 
67
                test_fail "added header still present stored mail";
 
68
        }
 
69
}
 
70
 
 
71
test_result_reset;
 
72
 
 
73
test_set "message" "${message}";
 
74
test "Alternating - delete; add" {
 
75
        deleteheader "Subject";
 
76
 
 
77
        if exists "subject" {
 
78
                test_fail "header not deleted";
 
79
        }
 
80
 
 
81
        redirect "frop@example.com";
 
82
 
 
83
        addheader "Subject" "Friep!";
 
84
 
 
85
        if not exists "subject" {
 
86
                test_fail "header not added";
 
87
        }
 
88
 
 
89
        if not header :is "subject" "Friep!" {
 
90
                test_fail "wrong content added";
 
91
        }
 
92
 
 
93
        fileinto :create "folder2";
 
94
 
 
95
        if not test_result_execute {
 
96
                test_fail "failed to execute result";
 
97
        }
 
98
 
 
99
        /* redirected message */
 
100
 
 
101
        if not test_message :smtp 0 {
 
102
                test_fail "message not redirected";
 
103
        }
 
104
 
 
105
        if exists "subject" {
 
106
                test_fail "deleted header still present redirected mail";
 
107
        }
 
108
        
 
109
        /* stored message message */
 
110
 
 
111
        if not test_message :folder "folder2" 0 {
 
112
                test_fail "message not stored";
 
113
        }
 
114
 
 
115
        if not exists "subject" {
 
116
                test_fail "added header not in stored mail";
 
117
        }
 
118
 
 
119
        if not header :is "subject" "Friep!" {
 
120
                test_fail "wrong content in redirected mail ";
 
121
        }
 
122
}