summaryrefslogtreecommitdiffabout
path: root/tests
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-11 21:52:43 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-03-11 21:52:43 (GMT)
commit7c10eca883faa5dd5b01bf1e50b04abb792a6639 (patch) (side-by-side diff)
tree51fc8746681d42bca8034f88510ff7f144215e70 /tests
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') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/atlocal.in6
-rw-r--r--tests/check-notify.at3
-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
-rw-r--r--tests/mailstats.at3
-rw-r--r--tests/notify-upl.at3
-rw-r--r--tests/upload-dry.at2
9 files changed, 88 insertions, 40 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 50c5a60..89cfd3f 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -30,7 +30,11 @@ wydawca_clean_testdirs() {
}
wydawca_expandmeta() {
- sed "s/@USER@/$USER/g;s,@WD_SRC@,$WD_SRC,g;s,@WD_DST@,$WD_DST,g;s,@WD_CONFSRC@,$WD_CONFSRC,g" $1 > $2
+ sed "s/@USER@/$USER/g;
+ s,@WD_SRC@,$WD_SRC,g;
+ s,@WD_DST@,$WD_DST,g;
+ s,@WD_CONFSRC@,$WD_CONFSRC,g;
+ s,@WD_MODDIR@,@abs_top_builddir@/modules/mailutils,g" $1 > $2
}
wydawca_config() {
diff --git a/tests/check-notify.at b/tests/check-notify.at
index 7be4741..bebfa4b 100644
--- a/tests/check-notify.at
+++ b/tests/check-notify.at
@@ -71,7 +71,8 @@ AT_CHECK([
wydawca_init_testdirs
wydawca_config wydawca.rc
mv wydawca.rc simple.rc
-cat $WD_CONFSRC/notify.rc simple.rc > wydawca.rc
+wydawca_config notify.rc
+cat notify.rc simple.rc >> wydawca.rc
wydawca_upload fail file
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}";
-
diff --git a/tests/mailstats.at b/tests/mailstats.at
index 59f8e0c..e5c769d 100644
--- a/tests/mailstats.at
+++ b/tests/mailstats.at
@@ -69,7 +69,8 @@ Wydawca
AT_CHECK([
wydawca_init_testdirs
wydawca_config wydawca.rc
-cat $WD_CONFSRC/mailstats.rc >> wydawca.rc
+wydawca_config mailstats.rc
+cat mailstats.rc >> wydawca.rc
wydawca_upload test file
wydawca_expandmeta errtmpl experr
diff --git a/tests/notify-upl.at b/tests/notify-upl.at
index ee35056..b6425ba 100644
--- a/tests/notify-upl.at
+++ b/tests/notify-upl.at
@@ -82,7 +82,8 @@ AT_CHECK([
wydawca_init_testdirs
wydawca_config wydawca.rc
mv wydawca.rc simple.rc
-cat $WD_CONFSRC/notify.rc simple.rc > wydawca.rc
+wydawca_config notify.rc
+cat notify.rc simple.rc >> wydawca.rc
wydawca_upload test file
wydawca_expandmeta errtmpl experr
diff --git a/tests/upload-dry.at b/tests/upload-dry.at
index e2e4063..56ccc67 100644
--- a/tests/upload-dry.at
+++ b/tests/upload-dry.at
@@ -23,7 +23,7 @@ wydawca: [[DEBUG]] @WD_SRC@/fail -> @WD_DST@
wydawca: [[DEBUG]] @WD_SRC@/test -> @WD_DST@
wydawca: [[DEBUG]] processing spool test (@WD_DST@)
wydawca: [[DEBUG]] FILE file, DIST=file, SIG=file.sig, DIRECTIVE=file.directive.asc
-wydawca: [[NOTICE]] Good signature from Wydawca (Testsuite) <bug-wydawca@gnu.org.ua>
+wydawca: [[DEBUG]] Good signature from Wydawca (Testsuite) <bug-wydawca@gnu.org.ua>
wydawca: [[DEBUG]] file: directive file signature OK
wydawca: [[NOTICE]] file.directive.asc: VERSION: 1.1
wydawca: [[DEBUG]] processing triplet `file'

Return to:

Send suggestions and report system problems to the System administrator.