aboutsummaryrefslogtreecommitdiff
path: root/tests/etc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-11 23:52:43 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-03-11 23:52:43 +0200
commit7c10eca883faa5dd5b01bf1e50b04abb792a6639 (patch)
tree51fc8746681d42bca8034f88510ff7f144215e70 /tests/etc
parent10a5f20232d2a57beb0a50b38b1d7196a7f5236e (diff)
downloadwydawca-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.am4
-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.rcin6
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
@@ -18,15 +18,15 @@ GPGFILES = secring.gpg pubring.gpg
noinst_DATA = @WYDAWCA_GPGFILES@
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
$(GPG) $(GPG_FLAGS) --import < $(srcdir)/pubring.asc
$(GPG) $(GPG_FLAGS) --allow-secret-key-import --import < $(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
@@ -11,15 +11,23 @@
# 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
+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
caused the following results:
errors ............................. ${stat:errors}
@@ -36,7 +44,13 @@ files archived ..................... ${stat:archives}
symlinks created ................... ${stat:symlinks}
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
@@ -11,54 +11,71 @@
# 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/>.
+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.
Files uploaded:
${triplet:ls:upload}$-
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
for ${project} to ${url}/${dir}. Files uploaded:
${triplet:ls:upload}$-
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}
has attempted to upload the following files to ${url}/${dir}:
${triplet:ls:full}$-
@@ -70,23 +87,26 @@ releases for ${project}, please contact <puszcza-hackers@gnu.org.ua>.
Otherwise, let us know so we could undertake appropriate measures.
Regards,
Wydawca
The Project Submission Robot
EOT;
+ }
}
# Notify the user (submitter), if the directive signature does not match
# his record.
# It may be a good idea not to notify users about such events, just to
# 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}.
However, the signature of the directive file was wrong, which looks
suspicious. The person uploaded the following files:
@@ -98,20 +118,23 @@ try again. If not, please let us know as soon as possible, so we can
track down the person trying to make believe he is you.
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
for ${project}. However, the signature of the directive file was wrong,
which looks suspicious. The person uploaded the following files:
@@ -120,23 +143,26 @@ ${triplet:ls:full}
This upload has been ignored and the files removed.
Regards,
Wydawca
The Project Submission Robot
EOT;
+ }
}
# Notify the user (submitter), if the detached signature does not match
# his record.
# It may be a good idea not to notify users about such events, just to
# 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}.
However, the detached signature signature was wrong, which looks
suspicious. The person uploaded the following files:
@@ -148,20 +174,23 @@ try again. If not, please let us know as soon as possible, so we can
track down the person trying to make believe he is you.
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
for ${project}. However, the detached signature file was wrong,
which looks suspicious. The person uploaded the following files:
@@ -170,18 +199,21 @@ ${triplet:ls:full}
This upload has been ignored and the files removed.
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
verification procedure with the following diagnostics:
${check:diagn}$-
@@ -189,9 +221,10 @@ ${check:diagn}$-
Please fix the tarball and resubmit.
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
@@ -92,12 +92,6 @@ spool ckok {
url ftp://wydawca.ckok;
source "@WD_SRC@/ok";
destination "@WD_DST@";
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}";
-

Return to:

Send suggestions and report system problems to the System administrator.