diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-04-23 21:14:49 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-04-23 21:27:47 +0300 |
commit | 8234484dba123ad8001657def8fb57133f9610bf (patch) | |
tree | 3c648730985b0ec37ed6fa5af7fe35fedaeb3c31 /tests | |
parent | 80466e8f237077f11134554ab1a68b47f49616e2 (diff) | |
download | wydawca-8234484dba123ad8001657def8fb57133f9610bf.tar.gz wydawca-8234484dba123ad8001657def8fb57133f9610bf.tar.bz2 |
Rewrite the testsuite.
Use gpg2 to create the keys, and sign files as necessary.
* NEWS: Update.
* doc/wydawca.texi: Update.
* configure.ac: Detect the presence of GPG version 2.
* src/cmdline.opt (--single-process): Remove.
* src/config.c: Remove the "single-process" statement.
* src/triplet.c (triplet_enqueue): Fix eventual NULL dereference.
(wy_triplet_wait): Update the WY_STAT_INCOMPLETE_TRIPLETS counter.
* src/wydawca.c (single_process_option): Remove global.
* src/wydawca.h (single_process): Remove global.
* tests/.gitignore: Update.
* tests/Makefile.am: Update.
* tests/atlocal.in: Rewrite.
* tests/chargen.c: New auxiliary tool
* tests/dist/file: Remove.
* tests/dist/file.directive.asc: Remove.
* tests/dist/file.sig: Remove.
* tests/dist/file12f.directive.asc: Remove.
* tests/dist/file12t.directive.asc: Reemove.
* tests/dist/rmsymlink.directive.asc: Remove.
* tests/dist/symlink.directive.asc: Remove.
* tests/etc/notify.cfin: Rename to tests/etc/notify.cf
* tests/etc/Makefile.am: Update.
* tests/etc/dbgen.sh: New file.
* tests/etc/keygen.sh: New file.
* tests/etc/project: New file.
* tests/etc/pubring.asc: Remove.
* tests/etc/secring.asc: Remove.
* tests/etc/wydawca.cfin: Remove.
* tests/*.at: Rewrite.
Diffstat (limited to 'tests')
45 files changed, 1278 insertions, 950 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index e5a908e..6a471f2 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -10,3 +10,4 @@ cwdrepl wyasync wyclt wyinit +chargen diff --git a/tests/Makefile.am b/tests/Makefile.am index fb971d5..8374916 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Wydawca. If not, see <http://www.gnu.org/licenses/>. -EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 dist +EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 DISTCLEANFILES = atconfig $(check_SCRIPTS) MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) SUBDIRS = etc @@ -40,31 +40,33 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac ## ------------ ## TESTSUITE_AT = \ + testsuite.at\ backup00.at\ backup01.at\ backup02.at\ backup03.at\ + dry_run00.at\ + dry_run01.at\ + dry_run02.at\ + upload00.at\ + upload01.at\ + upload02.at\ + symlink00.at\ + symlink01.at\ + rmsymlink00.at\ + mailnotify.at\ + mailstats.at\ + check-ok.at\ check-fail.at\ check-notify.at\ - check-ok.at\ inotify-ok.at\ - inotify-rmsymlink.at\ inotify-symlink.at\ + inotify-rmsymlink.at\ inotify-unatt00.at\ inotify-unatt01.at\ - notify-upl.at\ - mailstats.at\ - rmsymlink00.at\ - symlink00.at\ - symlink01.at\ - testsuite.at\ - upload.at\ - upload-dry.at\ - upl11.at\ - upl12f.at\ - upl12t.at\ unp00.at\ unp01.at\ + unp02.at\ unp-idle.at\ version.at @@ -89,7 +91,7 @@ check-local: atconfig atlocal $(TESTSUITE) #installcheck-local: # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin -check_PROGRAMS = bkupname cwdrepl wyinit wyasync wyclt +check_PROGRAMS = bkupname cwdrepl wyinit wyasync wyclt chargen AM_CPPFLAGS = \ @GRECS_INCLUDES@ \ -I$(top_srcdir)/include\ diff --git a/tests/atlocal.in b/tests/atlocal.in index 6102995..0d7c732 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -8,66 +8,130 @@ XFAILFILE=$abs_builddir/.badversion trap "test -r $XFAILFILE && cat $XFAILFILE; exit $?" 1 2 13 15 -WY_CONFSRC=@abs_top_srcdir@/tests/etc -WY_DISTDIR=@abs_top_srcdir@/tests/dist -WY_SRC=@abs_top_builddir@/tests/source -WY_DST=dest WY_TESTDIR=@abs_top_builddir@/tests +WY_CONFSRC=@abs_top_srcdir@/tests/etc +WY_CONFDST=$WY_TESTDIR/etc +WY_PROJECTDB=$WY_CONFSRC/project WY_MAILUTILS=@WY_MAILUTILS@ WY_INOTIFY=@WY_INOTIFY@ -MKDIR_P="@MKDIR_P@" +WY_MODDIR=@abs_top_builddir@/modules/mailutils -if test -w /; then - WY_FORCE=--force -else - WY_FORCE= -fi +GPG="@GPG@ --quiet --no-permission-warning --batch " +GNUPGHOME=$WY_CONFDST/gnupg +export GNUPGHOME ulimit -c unlimited -wydawca_expandmeta() { - sed -e "s/@USER@/$USER/g" \ - -e "s,@CWD@,$PWD,g" \ - -e "s,@WY_SRC@,$WY_SRC,g" \ - -e "s,@WY_DST@,$WY_DST,g" \ - -e "s,@WY_CONFSRC@,$WY_CONFSRC,g" \ - -e "s,@WY_TESTDIR@,$WY_TESTDIR,g" \ - -e "s,@WY_MODDIR@,@abs_top_builddir@/modules/mailutils,g" $1 > $2 -} +# ##################################### +# Utility functions +# ##################################### -wydawca_config() { - wydawca_expandmeta $WY_CONFSRC/${1}in $1 - wyinit $1 +# wy_project_lookup PROJECT WHAT +wy_project_lookup() { + test $# -eq 2 || echo >&2 "wy_project_lookup: bad number of arguments" + local n + case $2 in + PROJECT_NAME) n=1;; + REAL_NAME) n=2;; + EMAIL) n=3;; + COMMENT) n=4;; + esac + grep "^$1:" $WY_PROJECTDB | cut -d: -f$n } + +# wy_create_directive [-v X.Y] [-u USER] FILENAME PROJECT [DIRECTIVE: VALUE ...] +wy_create_directive() { + local version user + while [ $# -ne 0 ] + do + case $1 in + -v) version=$2 + shift 2;; + -u) user=$2 + shift 2;; + --) shift + break;; + *) break + esac + done -wydawca_upload() { - dir=source/$1 - shift - file=$1 - shift - cp "$WY_DISTDIR/$file" "$dir" - cp "$WY_DISTDIR/$file.sig" "$dir" - if test -n "$1"; then - cp "$WY_DISTDIR/$1" "$dir/$file.directive.asc" - else - cp "$WY_DISTDIR/$file.directive.asc" "$dir" + : ${version:=1.2} + + local filename="$1.directive" project=$2 + shift 2 + if [ $(( $# % 2 )) -ne 0 ]; then + echo >&2 "wy_create_directive: odd number of arguments" + exit 1 fi + (echo "version: $version" + echo "directory: $project" + while [ $# -gt 0 ] + do + echo "$1 $2" + shift 2 + done) > $filename + rm -f $filename.asc + : ${user:=$(wy_project_lookup $project REAL_NAME)} + rm -f $filename.asc + $GPG --clearsign -u "$user" -o $filename.asc $filename + rm $filename } -wydawca_cmp() { - p=$1 - shift - for file in $@ +# wy_genfile [-u USER] [-l SIZE] PROJECT NAME +wy_genfile() { + local length user + while [ $# -ne 0 ] do - cmp "$WY_DISTDIR/$file" "$WY_DST/$p/$file" || exit 1 + case $1 in + -l) length="-l $2" + shift 2;; + -u) user=$2 + shift 2;; + --) shift + break;; + *) break + esac done + + local project=$1 filename=$2 + chargen $length > $filename + + : ${user:=$(wy_project_lookup $project REAL_NAME)} + rm -f $filename.sig + $GPG -ba -o $filename.sig $filename } -wydawca_cmparc() { - p=$1 - shift - for file in $@ +# wy_create_upload [-u USER] [-l SIZE] PROJECT NAME [DIRECTIVE: VALUE...] +wy_create_upload() { + local length_option user_option + while [ $# -ne 0 ] do - cmp "$WY_DISTDIR/$file" "$WY_DST/$p/archive/$file" || exit 1 + case $1 in + -l) + length_option="$1 $2" + shift 2;; + -u) + user_option="$1 $2" + shift 2;; + --) shift + break;; + *) break + esac done + local project=$1 filename=$2 + shift 2 + wy_genfile $length_option $user_option $project $filename + wy_create_directive $user_option $filename $project\ + filename: $(basename $filename)\ + "$@" +} + +wy_config_head() { + cat <<EOF +pidfile $PWD/wydawca.pid; +statistics all; +umask 022; +create-directories yes; +#include "$WY_CONFDST/database.cf" +EOF } diff --git a/tests/chargen.c b/tests/chargen.c new file mode 100644 index 0000000..13ef8f5 --- /dev/null +++ b/tests/chargen.c @@ -0,0 +1,79 @@ +/* + NAME + chargen - generate a stream of characters + + SYNOPSIS + chargen [-c C] [-l LEN] [-p] [-s N] + + DESCRIPTION + Produces on standard output a stream of characters. The stream consists + of all 256 characters repeated cyclically until total number of characters + reaches 4096 (or LEN). + + OPTIONS + -c C Start from ASCII character C + + -l LEN + Stop when LEN characters have been generated. + + -p Produce only printable characters + + -s N Start from character with ordinal number N +*/ +#include <stdio.h> +#include <stdlib.h> +#include <limits.h> +#include <unistd.h> +#include <errno.h> +#include <ctype.h> + +int +main(int argc, char **argv) +{ + int c; + int start = 0; + int mod = UCHAR_MAX; + size_t i, len = 4096; + int printable = 0; + char *p; + + while ((c = getopt(argc, argv, "cl:ps:")) != EOF) { + switch (c) { + case 'c': + start = optarg[0]; + break; + case 'p': + printable = 1; + break; + case 's': + start = atoi(optarg) % UCHAR_MAX; + break; + case 'l': + errno = 0; + len = strtoul(optarg, &p, 10); + if (*p) { + fprintf(stderr, "bad length (near %s)", p); + exit(1); + } else if (errno) { + perror("bad length"); + exit(1); + } + break; + default: + exit(2); + } + } + + if (printable && !isprint(start)) + do { + start = (start + 1) % mod; + } while (printable && !isprint(start)); + + for (i = 0; i < len; i++) { + putchar(start); + do { + start = (start + 1) % mod; + } while (printable && !isprint(start)); + } + return 0; +} diff --git a/tests/check-fail.at b/tests/check-fail.at index 268ca47..4c4b1c9 100644 --- a/tests/check-fail.at +++ b/tests/check-fail.at @@ -16,15 +16,28 @@ AT_SETUP([Verification test failure]) AT_KEYWORDS([uploads check-test check-fail]) - -AT_DATA([experr], +AT_CHECK_UPLOAD([ +spool test { + url ftp://wydawca.test; + source "$PWD/upload"; + destination "$PWD/dest"; + check-script "exit 1"; +} +], +[wy_create_upload conversion upload/conversion-1.1.tar +cp -a upload orig +set -e +wydawca --no-preproc -c wydawca.cf 2>err +cat err | cwdrepl >&2 +], +[0], +[], [wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started -wydawca: [[NOTICE]] file.directive.asc: VERSION: 1.1 -wydawca: [[NOTICE]] file.directive.asc: COMMENT: Gnupload for Wydawca testsuite -wydawca: [[ERR]] spool check script for file@ckfail returned 1 -wydawca: [[NOTICE]] removing ./source/fail/file -wydawca: [[NOTICE]] removing ./source/fail/file.sig -wydawca: [[NOTICE]] removing ./source/fail/file.directive.asc +wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: VERSION: 1.2 +wydawca: [[ERR]] spool check script for conversion-1.1.tar@test returned 1 +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar.sig +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar.directive.asc wydawca: [[INFO]] errors: 1 wydawca: [[INFO]] warnings: 0 wydawca: [[INFO]] bad signatures: 0 @@ -41,16 +54,6 @@ wydawca: [[INFO]] symlinks removed: 0 wydawca: [[INFO]] check failures: 1 wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished ]) +AT_CLEANUP -AT_CHECK([ -wydawca_config wydawca.cf -wydawca_upload fail file - -wydawca $WY_FORCE --no-preproc -c wydawca.cf 2>err -cat err | cwdrepl >&2 -], -[0], -[], -[experr]) -AT_CLEANUP diff --git a/tests/check-notify.at b/tests/check-notify.at index 298ebd0..63a00a4 100644 --- a/tests/check-notify.at +++ b/tests/check-notify.at @@ -17,14 +17,67 @@ AT_SETUP([Verification test failure notification]) AT_KEYWORDS([uploads check-test check-fail check-fail-notify notify]) -AT_DATA([experr], +AT_CHECK_UPLOAD([ +module-prepend-load-path "$WY_MODDIR"; +module mailutils mod_mailutils.la; +module-init mailutils { + admin-address "root@localhost"; + from-address "wydawca-noreply@localhost"; + mailer "| $WY_TESTDIR/nullmail -o $PWD/mail.out -F \${sender} \${rcpt}"; +} + +#include "$WY_CONFSRC/notify.cf" + +spool test { + url ftp://wydawca.test; + source "$PWD/upload"; + destination "$PWD/dest"; + check-script <<EOT +echo WYDAWCA_SPOOL=\$WYDAWCA_SPOOL +echo WYDAWCA_SOURCE=\$WYDAWCA_SOURCE +echo WYDAWCA_DEST=\$WYDAWCA_DEST +echo WYDAWCA_URL=\$WYDAWCA_URL +echo WYDAWCA_TRIPLET_BASE=\$WYDAWCA_TRIPLET_BASE +echo WYDAWCA_DIST_FILE=\$WYDAWCA_DIST_FILE +exit 1 +EOT; +} +], +[wy_create_upload conversion upload/conversion-1.1.tar +cp -a upload orig +set -e +wydawca --no-preproc -c wydawca.cf 2>err +cat err | cwdrepl >&2 +cat mail.out | cwdrepl +], +[0], +[From wydawca-noreply@localhost +From: wydawca-noreply@localhost +To: "Wydawca tester for the Conversion project" <jeannot@example.com> +Subject: conversion-1.1.tar rejected + +Your upload of conversion-1.1.tar has been rejected by the distribution +verification procedure with the following diagnostics: + +WYDAWCA_SPOOL=test +WYDAWCA_SOURCE=./upload +WYDAWCA_DEST=./dest +WYDAWCA_URL=ftp://wydawca.test +WYDAWCA_TRIPLET_BASE=conversion-1.1.tar +WYDAWCA_DIST_FILE=conversion-1.1.tar + +Please fix the tarball and resubmit. + +Regards, +Wydawca +The Project Submission Robot +], [wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started -wydawca: [[NOTICE]] file.directive.asc: VERSION: 1.1 -wydawca: [[NOTICE]] file.directive.asc: COMMENT: Gnupload for Wydawca testsuite -wydawca: [[ERR]] spool check script for file@ckfail returned 1 -wydawca: [[NOTICE]] removing ./source/fail/file -wydawca: [[NOTICE]] removing ./source/fail/file.sig -wydawca: [[NOTICE]] removing ./source/fail/file.directive.asc +wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: VERSION: 1.2 +wydawca: [[ERR]] spool check script for conversion-1.1.tar@test returned 1 +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar.sig +wydawca: [[NOTICE]] removing ./upload/conversion-1.1.tar.directive.asc wydawca: [[INFO]] errors: 1 wydawca: [[INFO]] warnings: 0 wydawca: [[INFO]] bad signatures: 0 @@ -41,44 +94,6 @@ wydawca: [[INFO]] symlinks removed: 0 wydawca: [[INFO]] check failures: 1 wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished ]) +AT_CLEANUP -AT_DATA([expout], -[From wydawca-noreply@localhost -From: wydawca-noreply@localhost -To: "Wydawca Test User" <gray@localhost> -Subject: file rejected - -Your upload of file has been rejected by the distribution -verification procedure with the following diagnostics: - -WYDAWCA_SPOOL=ckfail -WYDAWCA_SOURCE=./source/fail -WYDAWCA_DEST=./dest -WYDAWCA_URL=ftp://wydawca.ckfail -WYDAWCA_TRIPLET_BASE=file -WYDAWCA_DIST_FILE=file - -Please fix the tarball and resubmit. - -Regards, -Wydawca -The Project Submission Robot -]) - -AT_CHECK([ -AT_MAILUTILS_PREREQ -wydawca_config wydawca.cf -mv wydawca.cf simple.cf -wydawca_config notify.cf -cat notify.cf simple.cf >> wydawca.cf - -wydawca_upload fail file -wydawca $WY_FORCE --no-preproc -c wydawca.cf 2>err || exit $? -cat err | cwdrepl >&2 -cat mail.out | cwdrepl -], -[0], -[expout], -[experr]) -AT_CLEANUP diff --git a/tests/check-ok.at b/tests/check-ok.at index 11ee9a1..a7090da 100644 --- a/tests/check-ok.at +++ b/tests/check-ok.at @@ -16,11 +16,25 @@ AT_SETUP([Verification test success]) AT_KEYWORDS([uploads check-test check-success check-ok]) - -AT_DATA([experr], +AT_CHECK_UPLOAD([ +spool test { + url ftp://wydawca.test; + source "$PWD/upload"; + destination "$PWD/dest"; + check-script "exit 0"; +} +], +[wy_create_upload conversion upload/conversion-1.1.tar +cp -a upload orig +set -e +wydawca --no-preproc -c wydawca.cf +cmp orig/conversion-1.1.tar dest/conversion/conversion-1.1.tar +cmp orig/conversion-1.1.tar.sig dest/conversion/conversion-1.1.tar.sig +], +[0], +[], [wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started -wydawca: [[NOTICE]] file.directive.asc: VERSION: 1.1 -wydawca: [[NOTICE]] file.directive.asc: COMMENT: Gnupload for Wydawca testsuite +wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: VERSION: 1.2 wydawca: [[INFO]] errors: 0 wydawca: [[INFO]] warnings: 0 wydawca: [[INFO]] bad signatures: 0 @@ -37,16 +51,6 @@ wydawca: [[INFO]] symlinks removed: 0 wydawca: [[INFO]] check failures: 0 wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished ]) +AT_CLEANUP -AT_CHECK([ -wydawca_config wydawca.cf -wydawca_upload ok file -wydawca $WY_FORCE --no-preproc -c wydawca.cf 2>err|| exit $? -cat err | cwdrepl >&2 -wydawca_cmp proj file file.sig -], -[0], -[], -[experr]) -AT_CLEANUP diff --git a/tests/dist/file b/tests/dist/file deleted file mode 100644 index 2635c5c..0000000 --- a/tests/dist/file +++ /dev/null @@ -1 +0,0 @@ -This is a test file for Wydawca testsuite. diff --git a/tests/dist/file.directive.asc b/tests/dist/file.directive.asc deleted file mode 100644 index 0f40f6f..0000000 --- a/tests/dist/file.directive.asc +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -version: 1.1 -directory: proj -comment: Gnupload for Wydawca testsuite -filename: file ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.7 (GNU/Linux) - -iD8DBQFJnExlCZA3/2YT9iMRAgm7AJ9SLO/vihu3PeAwyRQsJp85NVC9swCdE+FQ -SF9/JnHygja6qb5KRZEleuw= -=RjYY ------END PGP SIGNATURE----- diff --git a/tests/dist/file.sig b/tests/dist/file.sig deleted file mode 100644 index 31cdef1..0000000 --- a/tests/dist/file.sig +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.7 (GNU/Linux) - -iD8DBQBJnExlCZA3/2YT9iMRAjDIAKCSt2MbRo8g9P9y/u9WZp1tGlVShwCeI7K+ -3G2UCTc/xlj200mHP2+B84M= -=UO+/ ------END PGP SIGNATURE----- diff --git a/tests/dist/file12f.directive.asc b/tests/dist/file12f.directive.asc deleted file mode 100644 index 11b206d..0000000 --- a/tests/dist/file12f.directive.asc +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -version: 1.2 -directory: proj -comment: Gnupload for Wydawca testsuite -filename: file -replace: false ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) - -iEYEARECAAYFAk/B+FwACgkQCZA3/2YT9iN1CQCgh9sbdy1zz6o6jTJRGXAbjClq -jvoAn3wcsnvIzx2vZchPMSfpJ3ZaPV1f -=g4s4 ------END PGP SIGNATURE----- diff --git a/tests/dist/file12t.directive.asc b/tests/dist/file12t.directive.asc deleted file mode 100644 index 921ca1e..0000000 --- a/tests/dist/file12t.directive.asc +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -version: 1.2 -directory: proj -comment: Gnupload for Wydawca testsuite -filename: file -replace: true ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) - -iEYEARECAAYFAk/B+GAACgkQCZA3/2YT9iMwzgCgzIWjeAwRlI0aLgUAo8XafrId -qLsAoIQp2r63b+WxDdvwDrvXBwtQJq1x -=t6tj ------END PGP SIGNATURE----- diff --git a/tests/dist/rmsymlink.directive.asc b/tests/dist/rmsymlink.directive.asc deleted file mode 100644 index e6a520e..0000000 --- a/tests/dist/rmsymlink.directive.asc +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -version: 1.2 -directory: proj -comment: remove symlink -rmsymlink: file-latest ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iEYEARECAAYFAl6UodIACgkQCZA3/2YT9iNb7wCgjHrB9xDfdndQISqF+SwQbeJi -PVAAoKlzBCycNslZ4bo7h36Nenfv3k9u -=CTgS ------END PGP SIGNATURE----- diff --git a/tests/dist/symlink.directive.asc b/tests/dist/symlink.directive.asc deleted file mode 100644 index 4654f48..0000000 --- a/tests/dist/symlink.directive.asc +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -version: 1.2 -directory: proj -comment: create a symlink -symlink: file file-latest ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iEYEARECAAYFAl6UhygACgkQCZA3/2YT9iOH3wCgvJmS3Q5FcLQvhwZisDzNCQGS -klQAn3KHpEHp1YjBV3U2tvSAcGhYUwd5 -=vx2j ------END PGP SIGNATURE----- diff --git a/tests/upload.at b/tests/dry_run00.at index 5eb4e64..b8202fd 100644 --- a/tests/upload.at +++ b/tests/dry_run00.at @@ -1,4 +1,4 @@ -# Check working uploads -*- Autotest -*- +# Check dry-run uploads -*- Autotest -*- # Copyright (C) 2009-2012, 2017, 2019-2020 Sergey Poznyakoff # # Wydawca is free software; you can redistribute it and/or modify @@ -13,13 +13,25 @@ # # 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]) - -AT_DATA([experr], +AT_SETUP([Dry-run upload]) +AT_KEYWORDS([upload upload-single upload-success dry-run]) +AT_CHECK_UPLOAD([ +spool test { + url ftp://wydawca.test; + source "$PWD/upload"; + destination "$PWD/dest"; +} +], +[wy_create_upload conversion upload/conversion-1.1.tar \ + comment: "Dry-run upload" +set -e +wydawca --no-preproc --dry-run --debug=0 -c wydawca.cf +], +[0], +[], [wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) started -wydawca: [[NOTICE]] file.directive.asc: VERSION: 1.1 -wydawca: [[NOTICE]] file.directive.asc: COMMENT: Gnupload for Wydawca testsuite +wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: VERSION: 1.2 +wydawca: [[NOTICE]] conversion-1.1.tar.directive.asc: COMMENT: Dry-run upload wydawca: [[INFO]] errors: 0 wydawca: [[INFO]] warnings: 0 wydawca: [[INFO]] bad signatures: 0 @@ -36,15 +48,5 @@ wydawca: [[INFO]] symlinks removed: 0 wydawca: [[INFO]] check failures: 0 wydawca: [[NOTICE]] AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION) finished ]) - -AT_CHECK([ -wydawca_config wydawca.cf -wydawca_upload test file -wydawca $WY_FORCE --no-preproc -c wydawca.cf || exit $? -wydawca_cmp proj file file.sig -], -[0], -[], -[experr]) - AT_CLEANUP + diff --git a/tests/dry_run01.at b/tests/dry_run01.at new file mode 100644 index 0000000..387a9da --- /dev/null +++ b/tests/dry_run01.at @@ -0,0 +1,83 @@ +# Check dry-run uploads -*- Autotest -*- +# Copyright (C) 2009-2012, 2017, 2019-2020 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([Failed upload]) +AT_KEYWORDS([upload upload-single upload-failure dry-run]) +AT_CHECK_UPLOAD([ +spool test { + url ftp://wydawca.test; + source "$PWD/upload"; + destination "$PWD/dest"; +} +], +[wy_ |