diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-11 23:52:43 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-11 23:52:43 +0200 |
commit | 7c10eca883faa5dd5b01bf1e50b04abb792a6639 (patch) | |
tree | 51fc8746681d42bca8034f88510ff7f144215e70 /tests/etc | |
parent | 10a5f20232d2a57beb0a50b38b1d7196a7f5236e (diff) | |
download | wydawca-7c10eca883faa5dd5b01bf1e50b04abb792a6639.tar.gz wydawca-7c10eca883faa5dd5b01bf1e50b04abb792a6639.tar.bz2 |
Follow up to 87602f54.
Fix minor bugs. Update the testsuite. All tests pass now.
* modules/mailutils/mod_mailutils.c (cb_statistics): Remove. Use
wy_cb_statistics.
(expand_email_admin, expand_email_owner): Add missing functions.
* src/config.c (wy_cb_statistics): New function.
(wydawca_kw): Restore "statistics" statement.
* src/dictionary.c (dictionary_lookup): Fix debug levels.
* src/wydawca.h (wy_cb_statistics): New proto.
* tests/atlocal.in (wydawca_expandmeta): Expand @WD_MODDIR@
* tests/check-notify.at: Create notify.rc from notify.rcin
* tests/notify-upl.at: Likewise.
* tests/mailstats.at: Likewise.
* tests/upload-dry.at: Fix the expected output.
* tests/etc/mailstats.rc: Rename to tests/etc/mailstats.rcin.
* tests/etc/notify.rc: Rename to tests/etc/notify.rcin.
* tests/etc/Makefile.am: Update.
* tests/etc/wydawca.rcin: Update to the new syntax.
Diffstat (limited to 'tests/etc')
-rw-r--r-- | tests/etc/Makefile.am | 4 | ||||
-rw-r--r-- | tests/etc/mailstats.rcin (renamed from tests/etc/mailstats.rc) | 20 | ||||
-rw-r--r-- | tests/etc/notify.rcin (renamed from tests/etc/notify.rc) | 81 | ||||
-rw-r--r-- | tests/etc/wydawca.rcin | 6 |
4 files changed, 76 insertions, 35 deletions
diff --git a/tests/etc/Makefile.am b/tests/etc/Makefile.am index 4d1322b..086b659 100644 --- a/tests/etc/Makefile.am +++ b/tests/etc/Makefile.am @@ -21,9 +21,9 @@ EXTRA_DIST = \ pubring.asc\ secring.asc\ wydawca.rcin\ - notify.rc\ + notify.rcin\ nullmail\ - mailstats.rc + mailstats.rcin 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.rcin index c85345e..b3aeab7 100644 --- a/tests/etc/mailstats.rc +++ b/tests/etc/mailstats.rcin @@ -14,9 +14,17 @@ # 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 +module-prepend-load-path "@WD_MODDIR@"; +module mailutils mod_mailutils.la; +module-init mailutils { + admin-address "root@localhost"; + from-address "wydawca-noreply@localhost"; + + mailer "| @WD_CONFSRC@/nullmail @WD_DST@/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 @@ -39,4 +47,10 @@ symlinks removed ................... ${stat:rmsymlinks} Regards, Wydawca EOT; + } +} + +notify-event { + event statistics; + module mailutils; } diff --git a/tests/etc/notify.rc b/tests/etc/notify.rcin index 635e275..55f9c72 100644 --- a/tests/etc/notify.rc +++ b/tests/etc/notify.rcin @@ -14,11 +14,22 @@ # You should have received a copy of the GNU General Public License # along with Wydawca. If not, see <http://www.gnu.org/licenses/>. +module-prepend-load-path "@WD_MODDIR@"; +module mailutils mod_mailutils.la; +module-init mailutils { + admin-address "root@localhost"; + from-address "wydawca-noreply@localhost"; + + mailer "| @WD_CONFSRC@/nullmail @WD_DST@/mail.out -F ${sender} ${rcpt}"; +} + # Notify the user about successful uploads notify-event { - event success; - recipient user; - message <<EOT + event success; + module mailutils; + module-config { + recipient user; + message <<EOT Subject: Upload of ${project} successful Upload of ${project} to ${url}/${dir} finished successfully. @@ -30,13 +41,16 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify project admin about a successful upload. notify-event { - event success; - recipient owner; - message <<EOT + event success; + module mailutils; + module-config { + recipient owner; + message <<EOT Subject: Upload of ${project} successful ${user:real-name} (${user:email}) successfully uploaded files @@ -48,14 +62,17 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify project admin, if someone non authorized attempted to upload some # files for the project they run. notify-event { - event bad-ownership; - recipient owner; - message <<EOT + event bad-ownership; + module mailutils; + module-config { + recipient owner; + message <<EOT Subject: Suspicious upload of ${project} Someone not authorized to make releases for ${project} @@ -73,6 +90,7 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify the user (submitter), if the directive signature does not match @@ -81,9 +99,11 @@ EOT; # stay on a safe side. Notifying project admins (see below) should be quite # enough. notify-event { - event bad-directive-signature; - recipient user; - message <<EOT + event bad-directive-signature; + module mailutils; + module-config { + recipient user; + message <<EOT Subject: Suspicious upload of ${project} Someone (apparently you), has tried to make a release for ${project}. @@ -101,14 +121,17 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify the project admin, if submitted directive signature did not match # submitter record. notify-event { - event bad-directive-signature; - recipient owner; - message <<EOT + event bad-directive-signature; + module mailutils; + module-config { + recipient owner; + message <<EOT Subject: Suspicious upload of ${project} ${user:real-name} (${user:email}) has tried to make a release @@ -123,6 +146,7 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify the user (submitter), if the detached signature does not match @@ -131,9 +155,11 @@ EOT; # stay on a safe side. Notifying project admins (see below) should be quite # enough. notify-event { - event bad-detached-signature; - recipient user; - message <<EOT + event bad-detached-signature; + module mailutils; + module-config { + recipient user; + message <<EOT Subject: Suspicious upload of ${project} Someone (apparently you), has tried to make a release for ${project}. @@ -151,14 +177,17 @@ Regards, Wydawca The Project Submission Robot EOT; + } } # Notify the project admin, if submitted detached signature did not match # submitter record. notify-event { - event bad-detached-signature; - recipient owner; - message <<EOT + event bad-detached-signature; + module mailutils; + module-config { + recipient owner; + message <<EOT Subject: Suspicious upload of ${project} ${user:real-name} (${user:email}) has tried to make a release @@ -173,12 +202,15 @@ Regards, Wydawca The Project Submission Robot EOT; + } } notify-event { - event check-failure; - recipient user; - message <<EOT + event check-failure; + module mailutils; + module-config { + recipient user; + message <<EOT Subject: ${triplet:dist} rejected Your upload of ${triplet:dist} has been rejected by the distribution @@ -192,6 +224,7 @@ Regards, Wydawca The Project Submission Robot EOT; + } } diff --git a/tests/etc/wydawca.rcin b/tests/etc/wydawca.rcin index ec87a7b..d020eff 100644 --- a/tests/etc/wydawca.rcin +++ b/tests/etc/wydawca.rcin @@ -95,9 +95,3 @@ spool ckok { archive none; check-script "exit 0"; } - -admin-address "root@localhost"; -from-address "wydawca-noreply@localhost"; - -mailer "| @WD_CONFSRC@/nullmail @WD_DST@/mail.out -F ${sender} ${rcpt}"; - |