summaryrefslogtreecommitdiffabout
path: root/tests
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-19 19:07:28 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-02-19 19:07:28 (GMT)
commit62758ace16e756050f15b81e66ee5ab3bdd062ab (patch) (side-by-side diff)
tree5ca9f04bdf00988185e3df1ad2bd21854d27121a /tests
parent288ad3a8baf196011e791988b3251bbedb5f6cc2 (diff)
downloadwydawca-62758ace16e756050f15b81e66ee5ab3bdd062ab.tar.gz
wydawca-62758ace16e756050f15b81e66ee5ab3bdd062ab.tar.bz2
Improve testsuite
* src/mail.c (mail_send_message): Fix diagnostics. (mail_stats): Bail out if admin_address is not defined. * tests/mailstats.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add mailstats.at * tests/testsuite.at: Add mailstats.at * tests/etc/mailstats.rc: New file. * tests/etc/Makefile.am (EXTRA_DIST): Add missing files. * tests/etc/wydawca.rcin: Define admin-address, enforce newline at EOF. * tests/notify-upl.at, tests/upload-dry.at, tests/upload.at: Fix descriptions.
Diffstat (limited to 'tests') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/etc/Makefile.am8
-rw-r--r--tests/etc/mailstats.rc42
-rw-r--r--tests/etc/notify.rc16
-rw-r--r--tests/etc/wydawca.rcin20
-rw-r--r--tests/mailstats.at84
-rw-r--r--tests/notify-upl.at2
-rw-r--r--tests/testsuite.at3
-rw-r--r--tests/upload-dry.at2
-rw-r--r--tests/upload.at2
10 files changed, 174 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 41b079d..b170257 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -42,6 +42,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
TESTSUITE_AT = \
testsuite.at\
notify-upl.at\
+ mailstats.at\
upload.at\
upload-dry.at\
version.at
diff --git a/tests/etc/Makefile.am b/tests/etc/Makefile.am
index 267beef..dd2ea5b 100644
--- a/tests/etc/Makefile.am
+++ b/tests/etc/Makefile.am
@@ -17,7 +17,13 @@
GPGFILES = secring.gpg pubring.gpg
noinst_DATA = @WYDAWCA_GPGFILES@
-EXTRA_DIST = pubring.asc secring.asc wydawca.rcin
+EXTRA_DIST = \
+ pubring.asc\
+ secring.asc\
+ wydawca.rcin\
+ notify.rc\
+ nullmail\
+ mailstats.rc
GPG_FLAGS = --quiet --no-permission-warning --homedir .
pubring.gpg secring.gpg: $(srcdir)/pubring.asc $(srcdir)/secring.asc
diff --git a/tests/etc/mailstats.rc b/tests/etc/mailstats.rc
new file mode 100644
index 0000000..febad11
--- a/dev/null
+++ b/tests/etc/mailstats.rc
@@ -0,0 +1,42 @@
+# This file is part of Wydawca testsuite
+# Copyright (C) 2009 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/>.
+
+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;
+}
diff --git a/tests/etc/notify.rc b/tests/etc/notify.rc
index 00c6bda..8547b66 100644
--- a/tests/etc/notify.rc
+++ b/tests/etc/notify.rc
@@ -1,3 +1,19 @@
+# This file is part of Wydawca testsuite
+# Copyright (C) 2009 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/>.
+
# Notify the user about successful uploads
notify-event {
event success;
diff --git a/tests/etc/wydawca.rcin b/tests/etc/wydawca.rcin
index f8a8ce4..452f7c9 100644
--- a/tests/etc/wydawca.rcin
+++ b/tests/etc/wydawca.rcin
@@ -1,3 +1,19 @@
+# This file is part of Wydawca testsuite
+# Copyright (C) 2009 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/>.
+
statistics all;
umask 022;
@@ -66,6 +82,8 @@ directory ftp://wydawca.test {
archive none;
}
+admin-address "root@localhost";
from-address "wydawca-noreply@localhost";
-mailer "| @WD_CONFSRC@/nullmail @WD_DST@/mail.out -F ${sender} ${rcpt}"; \ No newline at end of file
+mailer "| @WD_CONFSRC@/nullmail @WD_DST@/mail.out -F ${sender} ${rcpt}";
+
diff --git a/tests/mailstats.at b/tests/mailstats.at
new file mode 100644
index 0000000..dc70ff4
--- a/dev/null
+++ b/tests/mailstats.at
@@ -0,0 +1,84 @@
+# Check mailing statistics -*- Autotest -*-
+# Copyright (C) 2009 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([Simple upload statistics])
+
+AT_DATA([errtmpl],
+[wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started
+wydawca: [[NOTICE]] file.directive.asc: COMMENT: Gnupload for Wydawca testsuite
+wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished
+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
+])
+
+AT_DATA([expout],
+[-F wydawca-noreply@localhost root@localhost
+=========
+To: root@localhost
+Subject: Wydawca stats
+X-Mailer: AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
+
+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
+])
+
+AT_CHECK([
+wydawca_init_testdirs
+wydawca_config wydawca.rc
+cat $WD_CONFSRC/mailstats.rc >> wydawca.rc
+wydawca_upload file file.directive.asc file.sig
+
+wydawca_expandmeta errtmpl experr
+ulimit -c unlimited
+wydawca --no-preproc -c wydawca.rc || exit $?
+wydawca_cmp proj file file.sig
+cat $WD_DST/mail.out
+],
+[0],
+[expout],
+[experr])
+
+wydawca_clean_testdirs
+
+AT_CLEANUP
diff --git a/tests/notify-upl.at b/tests/notify-upl.at
index bac8755..06c26c8 100644
--- a/tests/notify-upl.at
+++ b/tests/notify-upl.at
@@ -1,4 +1,4 @@
-# Checking wydawca version -*- Autotest -*-
+# Check success notifications -*- Autotest -*-
# Copyright (C) 2009 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
diff --git a/tests/testsuite.at b/tests/testsuite.at
index bc234f0..75709c8 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -24,4 +24,5 @@ AT_TESTED([wydawca])
m4_include([version.at])
m4_include([upload-dry.at])
m4_include([upload.at])
-m4_include([notify-upl.at]) \ No newline at end of file
+m4_include([notify-upl.at])
+m4_include([mailstats.at])
diff --git a/tests/upload-dry.at b/tests/upload-dry.at
index aba95d0..5814653 100644
--- a/tests/upload-dry.at
+++ b/tests/upload-dry.at
@@ -1,4 +1,4 @@
-# Checking wydawca version -*- Autotest -*-
+# Check dry-run uploads -*- Autotest -*-
# Copyright (C) 2009 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
diff --git a/tests/upload.at b/tests/upload.at
index a9b6e6b..1f3696c 100644
--- a/tests/upload.at
+++ b/tests/upload.at
@@ -1,4 +1,4 @@
-# Checking wydawca version -*- Autotest -*-
+# Check working uploads -*- Autotest -*-
# Copyright (C) 2009 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify

Return to:

Send suggestions and report system problems to the System administrator.