aboutsummaryrefslogtreecommitdiff
path: root/tests/mailstats.at
blob: 302efa10b9b3760df040d5b025afb37565fac605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Check mailing statistics                              -*- Autotest -*-
# Copyright (C) 2009-2012, 2017, 2019-2023 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Wydawca is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wydawca.  If not, see <http://www.gnu.org/licenses/>.

AT_SETUP([Mailing statistics])
AT_KEYWORDS([notify statistics mailstat])
AT_CHECK_UPLOAD([
module-prepend-load-path "$WY_MODDIR";
module mailutils mod_mailutils.so;
module-init mailutils {
    admin-address "root@localhost";
    from-address "wydawca-noreply@localhost";
    mailer "| $WY_TESTDIR/nullmail -o $PWD/mail.out -F \${sender} \${rcpt}";

    mail-statistics {
	statistics all;
	message <<EOT
Subject: Wydawca stats

This is to notify you that the recent run of wydawca
caused the following results:

errors ............................. \${stat:errors}
warning ............................ \${stat:warnings}
bad signatures ..................... \${stat:bad_signatures}
access violation attempts .......... \${stat:access_violations}
complete triplets .................. \${stat:complete_triplets}
incomplete triplets ................ \${stat:incomplete_triplets}
bad triplets ....................... \${stat:bad_triplets}
expired triplets ................... \${stat:expired_triplets}
triplet successes .................. \${stat:triplet_success}
files uploaded ..................... \${stat:uploads}
files archived ..................... \${stat:archives}
symlinks created ................... \${stat:symlinks}
symlinks removed ................... \${stat:rmsymlinks}

Regards,
Wydawca
EOT;
    }
}

notify-event {
	event finish;
	module mailutils;
}

spool test {
    url "ftp://wydawca.test";
    source "$PWD/upload";
    destination "$PWD/dest";
}
],
[AT_MAILUTILS_PREREQ
wy_create_upload conversion upload/conversion-1.1.tar
cp -a upload orig
set -e
wydawca --no-preproc -c wydawca.cf
cat mail.out
],
[0],
[From wydawca-noreply@localhost
From: wydawca-noreply@localhost
To: root@localhost
Subject: Wydawca stats

This is to notify you that the recent run of wydawca
caused the following results:

errors ............................. 0
warning ............................ 0
bad signatures ..................... 0
access violation attempts .......... 0
complete triplets .................. 1
incomplete triplets ................ 0
bad triplets ....................... 0
expired triplets ................... 0
triplet successes .................. 1
files uploaded ..................... 2
files archived ..................... 0
symlinks created ................... 0
symlinks removed ................... 0

Regards,
Wydawca
],
[wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started
wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: VERSION: 1.2
wydawca: [[INFO]] errors: 0
wydawca: [[INFO]] warnings: 0
wydawca: [[INFO]] bad signatures: 0
wydawca: [[INFO]] access violation attempts: 0
wydawca: [[INFO]] complete triplets: 1
wydawca: [[INFO]] incomplete triplets: 0
wydawca: [[INFO]] bad triplets: 0
wydawca: [[INFO]] expired triplets: 0
wydawca: [[INFO]] triplet successes: 1
wydawca: [[INFO]] files uploaded: 2
wydawca: [[INFO]] files archived: 0
wydawca: [[INFO]] symlinks created: 0
wydawca: [[INFO]] symlinks removed: 0
wydawca: [[INFO]] check failures: 0
wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.