aboutsummaryrefslogtreecommitdiff
path: root/tests/unp01.at
blob: 0a804c2bbe3496e75fff9eda4ac8f12cd18f04aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Test legacy upload notification requests  -*- Autotest -*-
# Copyright (C) 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([Multiple successful uploads])
AT_KEYWORDS([uploads unp unp01])

AT_WYDAWCA_DAEMON([
AT_SORT_PREREQ
socket=$(pwd)/wydawca.s
uploaddir=$(pwd)/source/ok
GNUPGHOME=$WY_CONFSRC
export socket uploaddir GNUPGHOME
],
[cat >> wydawca.cf <<EOT
inotify no;
listen $socket;
EOT
],
[
upload() {
    name=$1
    shift
    echo "$@" > $uploaddir/$name
    gpg --batch --no-tty -ba \
	-o $uploaddir/$name.sig $uploaddir/$name
    cat > $name.directive <<EOT
version: 1.2
directory: proj
filename: $name
EOT
    gpg --batch --no-tty --clearsign \
	-o $uploaddir/$name.directive.asc $name.directive
}

upload one "first distro" 2>gpg.err
upload two "second distro" 2>>gpg.err

wyclt $socket ckok
while ! test -f @CWD@/dest/proj/one && ! test -f @CWD@/dest/proj/one.sig 
do
  sleep 1
done
],
[find dest -type f|sort
],
[0],
[dest/proj/one
dest/proj/one.sig
dest/proj/two
dest/proj/two.sig
],
[ignore])

AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.