]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-key
add the gpg-classic variant to the gpgv/gnupg or-group
[apt.git] / test / integration / test-apt-key
CommitLineData
80f3aeb0
DK
1#!/bin/sh
2set -e
3
bc8f83a5
DK
4# apt-key is a shell script, so relatively prune to be effected by 'crazy' things:
5# confuses config parser as there exists no way of escaping " currently.
6#TMPDIR="$(mktemp -d)/This is \"fü\$\$ing cràzy\", \$(man man | head -n1 | cut -d' ' -f 1)\$!"
7# gpg doesn't like | in path names – documented e.g. in the man gpg2 --agent-program
8#TMPDIR="$(mktemp -d)/This is fü\$\$ing cràzy, \$(man man | head -n1 | cut -d' ' -f 1)\$!"
9TMPDIR_ADD="This is fü\$\$ing cràzy, \$(apt -v)\$!"
10
3abb6a6a
DK
11TESTDIR="$(readlink -f "$(dirname "$0")")"
12. "$TESTDIR/framework"
80f3aeb0
DK
13
14setupenvironment
15configarchitecture 'amd64'
16
93d0d08c
DK
17# start from a clean plate again
18cleanplate() {
0cfec3ab
DK
19 rm -rf "${ROOTDIR}/etc/apt/trusted.gpg.d/" "${ROOTDIR}/etc/apt/trusted.gpg"
20 mkdir "${ROOTDIR}/etc/apt/trusted.gpg.d/"
93d0d08c 21}
fb7b11eb
DK
22testmultigpg() {
23 testfailure --nomsg aptkey --quiet --readonly "$@"
0cfec3ab
DK
24 testsuccess grep "^gpgv: Can't check signature" "${ROOTDIR}/tmp/testfailure.output"
25 testsuccess grep '^gpgv: Good signature from' "${ROOTDIR}/tmp/testfailure.output"
fb7b11eb 26}
80f3aeb0 27
93d0d08c 28testrun() {
0cfec3ab
DK
29 echo "APT::Key::ArchiveKeyring \"${KEYDIR}/joesixpack.pub\";
30APT::Key::RemovedKeys \"${KEYDIR}/rexexpired.pub\";" > "${ROOTDIR}/etc/apt/apt.conf.d/aptkey.conf"
31
93d0d08c 32 cleanplate
0cfec3ab
DK
33 ln -sf "$(readlink -f "${KEYDIR}/joesixpack.pub")" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
34 testaptkeys 'Joe Sixpack'
80f3aeb0 35
0cfec3ab 36 testsuccess aptkey list
93d0d08c 37 msgtest 'Check that paths in list output are not' 'double-slashed'
0cfec3ab 38 testfailure --nomsg grep '//' "${ROOTDIR}/tmp/testsuccess.output"
80f3aeb0 39
0cfec3ab 40 testsuccess aptkey finger
93d0d08c 41 msgtest 'Check that paths in finger output are not' 'double-slashed'
0cfec3ab 42 testfailure --nomsg grep '//' "${ROOTDIR}/tmp/testsuccess.output"
80f3aeb0 43
19fdf93d
DK
44 testequalor2 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
45gpg: Total number processed: 1
46gpg: unchanged: 1' 'gpg: key 5A90D141DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
93d0d08c
DK
47gpg: Total number processed: 1
48gpg: unchanged: 1' aptkey --fakeroot update
80f3aeb0 49
f14cde2c 50 testaptkeys 'Joe Sixpack'
0cfec3ab 51 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg"
f14cde2c 52
0cfec3ab
DK
53 testsuccess aptkey --fakeroot add "${KEYDIR}/rexexpired.pub"
54 testfilestats "${ROOTDIR}/etc/apt/trusted.gpg" '%a' '=' '644'
04937adc 55
f14cde2c 56 testaptkeys 'Rex Expired' 'Joe Sixpack'
04937adc 57
38005d8b 58 msgtest 'Check that Sixpack key can be' 'exported'
0cfec3ab
DK
59 aptkey export 'Sixpack' > "${TMPWORKINGDIRECTORY}/aptkey.export"
60 aptkey --keyring "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg" exportall > "${TMPWORKINGDIRECTORY}/aptkey.exportall"
61 testsuccess --nomsg cmp "${TMPWORKINGDIRECTORY}/aptkey.export" "${TMPWORKINGDIRECTORY}/aptkey.exportall"
62 testsuccess test -s "${TMPWORKINGDIRECTORY}/aptkey.export"
63 testsuccess test -s "${TMPWORKINGDIRECTORY}/aptkey.exportall"
38005d8b 64
93d0d08c
DK
65 msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
66 testsuccess --nomsg aptkey --fakeroot update
67
f14cde2c 68 testaptkeys 'Joe Sixpack'
93d0d08c
DK
69
70 msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
0cfec3ab 71 testsuccess --nomsg aptkey --fakeroot --keyring "${ROOTDIR}/etc/apt/trusted.gpg" del DBAC8DAE
93d0d08c 72
f14cde2c 73 testaptkeys 'Joe Sixpack'
93d0d08c
DK
74
75 testsuccess aptkey --fakeroot del DBAC8DAE
76 testempty aptkey list
77
b0d40854 78 msgtest 'Test key removal with' 'lowercase key ID' #keylength somewhere between 8byte and short
05f64ca2 79 cleanplate
0cfec3ab 80 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
05f64ca2
DK
81 testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
82 testempty aptkey list
83
93d0d08c
DK
84 msgtest 'Test key removal with' 'single key in real file'
85 cleanplate
0cfec3ab 86 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
93d0d08c
DK
87 testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
88 testempty aptkey list
0cfec3ab
DK
89 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
90 testsuccess cmp "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
93d0d08c 91
031a3f25
DK
92 msgtest 'Test key removal with' 'different key specs'
93 cleanplate
0cfec3ab
DK
94 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
95 cp -a "${KEYDIR}/marvinparanoid.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/marvinparanoid.gpg"
031a3f25
DK
96 testsuccess --nomsg aptkey --fakeroot del 0xDBAC8DAE 528144E2
97 testempty aptkey list
0cfec3ab
DK
98 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
99 testsuccess cmp "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
100 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/marvinparanoid.gpg"
101 testsuccess cmp "${KEYDIR}/marvinparanoid.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/marvinparanoid.gpg~"
031a3f25 102
29f1b977
JM
103 msgtest 'Test key removal with' 'long key ID'
104 cleanplate
0cfec3ab 105 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
29f1b977
JM
106 testsuccess --nomsg aptkey --fakeroot del 5A90D141DBAC8DAE
107 testempty aptkey list
0cfec3ab
DK
108 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
109 testsuccess cmp "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
29f1b977 110
ba72845c
DK
111 msgtest 'Test key removal with' 'fingerprint'
112 cleanplate
0cfec3ab 113 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
ba72845c
DK
114 testsuccess --nomsg aptkey --fakeroot del 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
115 testempty aptkey list
0cfec3ab
DK
116 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
117 testsuccess cmp "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
ba72845c 118
93d0d08c
DK
119 msgtest 'Test key removal with' 'single key in softlink'
120 cleanplate
0cfec3ab 121 ln -s "$(readlink -f "${KEYDIR}/joesixpack.pub")" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
93d0d08c
DK
122 testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
123 testempty aptkey list
0cfec3ab
DK
124 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
125 testsuccess test -L "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
93d0d08c
DK
126
127 cleanplate
0cfec3ab
DK
128 testsuccess aptkey --fakeroot add "${KEYDIR}/joesixpack.pub"
129 ln -sf "$(readlink -f "${KEYDIR}/marvinparanoid.pub")" "${KEYDIR}/marvin paránöid.pub"
130 testsuccess aptkey --fakeroot add "${KEYDIR}/marvin paránöid.pub"
f14cde2c 131 testaptkeys 'Joe Sixpack' 'Marvin Paranoid'
0cfec3ab 132 cp -a "${ROOTDIR}/etc/apt/trusted.gpg" "${KEYDIR}/testcase-multikey.pub" # store for reuse
93d0d08c
DK
133
134 msgtest 'Test key removal with' 'multi key in real file'
135 cleanplate
0cfec3ab 136 cp -a "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
93d0d08c 137 testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
f14cde2c 138 testaptkeys 'Marvin Paranoid'
0cfec3ab 139 testsuccess cmp "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg~"
93d0d08c
DK
140
141 msgtest 'Test key removal with' 'multi key in softlink'
142 cleanplate
0cfec3ab 143 ln -s "$(readlink -f "${KEYDIR}/testcase-multikey.pub")" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
93d0d08c 144 testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
f14cde2c 145 testaptkeys 'Marvin Paranoid'
0cfec3ab
DK
146 testsuccess cmp "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg~"
147 testfailure test -L "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
148 testsuccess test -L "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg~"
93d0d08c
DK
149
150 msgtest 'Test key removal with' 'multiple files including key'
151 cleanplate
0cfec3ab
DK
152 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
153 cp -a "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
93d0d08c 154 testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
f14cde2c 155 testaptkeys 'Marvin Paranoid'
0cfec3ab
DK
156 testfailure test -e "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
157 testsuccess cmp "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg~"
158 testsuccess cmp "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg~"
0dae96a2
DK
159
160 cleanplate
0cfec3ab
DK
161 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
162 cp -a "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
f14cde2c 163 testaptkeys 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid'
0dae96a2 164 msgtest 'Test merge-back of' 'added keys'
0cfec3ab 165 testsuccess --nomsg aptkey adv --batch --yes --import "${KEYDIR}/rexexpired.pub"
f14cde2c 166 testaptkeys 'Rex Expired' 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid'
0dae96a2
DK
167
168 msgtest 'Test merge-back of' 'removed keys'
169 testsuccess --nomsg aptkey adv --batch --yes --delete-keys 27CE74F9
f14cde2c 170 testaptkeys 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid'
0dae96a2
DK
171
172 msgtest 'Test merge-back of' 'removed duplicate keys'
173 testsuccess --nomsg aptkey adv --batch --yes --delete-keys DBAC8DAE
f14cde2c 174 testaptkeys 'Marvin Paranoid'
b0d40854
DK
175
176 cleanplate
0cfec3ab
DK
177 cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
178 cp -a "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
179 local SIGNATURE="${TMPWORKINGDIRECTORY}/signature"
b0d40854 180 msgtest 'Test signing a file' 'with a key'
0cfec3ab
DK
181 echo 'Verify me. This is my signature.' > "$SIGNATURE"
182 echo 'lalalalala' > "${SIGNATURE}2"
183 testsuccess --nomsg aptkey --quiet --keyring "${KEYDIR}/marvinparanoid.pub" --secret-keyring "${KEYDIR}/marvinparanoid.sec" --readonly \
184 adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output "${SIGNATURE}.gpg" "${SIGNATURE}"
185 testsuccess test -s "${SIGNATURE}.gpg" -a -s "${SIGNATURE}"
b0d40854 186
2fac0dd5 187 msgtest 'Test verify a file' 'with no sig'
0cfec3ab 188 testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}" "${SIGNATURE}2"
2fac0dd5 189
19fdf93d 190 for GPGV in '' 'gpgv' 'gpgv1' 'gpgv2'; do
0cfec3ab 191 echo "APT::Key::GPGVCommand \"$GPGV\";" > "${ROOTDIR}/etc/apt/apt.conf.d/00gpgvcmd"
19fdf93d 192 if [ -n "$GPGV" ] && ! command dpkg -l gnupg1 2>&1 | grep -q '^ii'; then continue; fi
f14cde2c
DK
193
194 msgtest 'Test verify a file' 'with all keys'
0cfec3ab 195 testsuccess --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
b0d40854 196
f14cde2c 197 msgtest 'Test verify a file' 'with good keyring'
0cfec3ab 198 testsuccess --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
b0d40854 199
f14cde2c 200 msgtest 'Test fail verify a file' 'with bad keyring'
0cfec3ab 201 testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/joesixpack.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
b0d40854 202
f14cde2c 203 msgtest 'Test fail verify a file' 'with non-existing keyring'
0cfec3ab
DK
204 testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/does-not-exist.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
205 testfailure test -e "${KEYDIR}/does-not-exist.pub"
b0d40854 206
4e03c47d 207 # note: this isn't how apts gpgv method implements keyid for verify
f14cde2c 208 msgtest 'Test verify a file' 'with good keyid'
0cfec3ab 209 testsuccess --nomsg aptkey --quiet --readonly --keyid 'Paranoid' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
b0d40854 210
f14cde2c 211 msgtest 'Test fail verify a file' 'with bad keyid'
0cfec3ab 212 testfailure --nomsg aptkey --quiet --readonly --keyid 'Sixpack' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
b0d40854 213
f14cde2c 214 msgtest 'Test fail verify a file' 'with non-existing keyid'
0cfec3ab 215 testfailure --nomsg aptkey --quiet --readonly --keyid 'Kalnischkies' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
f14cde2c
DK
216
217 msgtest 'Test verify fails on' 'bad file'
0cfec3ab 218 testfailure --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}2"
f14cde2c 219 done
0cfec3ab 220 rm -f "${ROOTDIR}/etc/apt/apt.conf.d/00gpgvcmd"
fb7b11eb
DK
221
222 msgtest 'Test verify a file' 'with good keyring'
0cfec3ab 223 testsuccess --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
224
225 cleanplate
0cfec3ab
DK
226 cat "${KEYDIR}/joesixpack.pub" "${KEYDIR}/marvinparanoid.pub" > "${KEYDIR}/double.pub"
227 cat "${KEYDIR}/joesixpack.sec" "${KEYDIR}/marvinparanoid.sec" > "${KEYDIR}/double.sec"
228 cp -a "${KEYDIR}/double.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/double.gpg"
229 cp -a "${KEYDIR}/testcase-multikey.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/multikey.gpg"
230 rm -f "${SIGNATURE}.gpg"
231 testsuccess aptkey --quiet --keyring "${KEYDIR}/double.pub" --secret-keyring "${KEYDIR}/double.sec" --readonly \
232 adv --batch --yes -u 'Marvin' -u 'Joe' --armor --detach-sign --sign --output "${SIGNATURE}.gpg" "${SIGNATURE}"
233 testsuccess test -s "${SIGNATURE}.gpg" -a -s "${SIGNATURE}"
fb7b11eb 234
19fdf93d 235 for GPGV in '' 'gpgv' 'gpgv1' 'gpgv2'; do
0cfec3ab 236 echo "APT::Key::GPGVCommand \"$GPGV\";" > "${ROOTDIR}/etc/apt/apt.conf.d/00gpgvcmd"
19fdf93d 237 if [ -n "$GPGV" ] && ! command dpkg -l gnupg1 2>&1 | grep -q '^ii'; then continue; fi
fb7b11eb
DK
238
239 msgtest 'Test verify a doublesigned file' 'with all keys'
0cfec3ab 240 testsuccess --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
241
242 msgtest 'Test verify a doublesigned file' 'with good keyring joe'
0cfec3ab 243 testmultigpg --keyring "${KEYDIR}/joesixpack.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
244
245 msgtest 'Test verify a doublesigned file' 'with good keyring marvin'
0cfec3ab 246 testmultigpg --keyring "${KEYDIR}/marvinparanoid.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
247
248 msgtest 'Test fail verify a doublesigned file' 'with bad keyring'
0cfec3ab 249 testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/rexexpired.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
250
251 msgtest 'Test fail verify a doublesigned file' 'with non-existing keyring'
0cfec3ab
DK
252 testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/does-not-exist.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
253 testfailure test -e "${KEYDIR}/does-not-exist.pub"
fb7b11eb
DK
254
255 # note: this isn't how apts gpgv method implements keyid for verify
256 msgtest 'Test verify a doublesigned file' 'with good keyid'
0cfec3ab 257 testmultigpg --keyid 'Paranoid' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
258
259 msgtest 'Test fail verify a doublesigned file' 'with bad keyid'
0cfec3ab 260 testfailure --nomsg aptkey --quiet --readonly --keyid 'Rex' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
261
262 msgtest 'Test fail verify a doublesigned file' 'with non-existing keyid'
0cfec3ab 263 testfailure --nomsg aptkey --quiet --readonly --keyid 'Kalnischkies' verify "${SIGNATURE}.gpg" "${SIGNATURE}"
fb7b11eb
DK
264
265 msgtest 'Test verify fails on' 'bad doublesigned file'
0cfec3ab 266 testfailure --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}2"
fb7b11eb 267 done
0cfec3ab 268 rm -f "${ROOTDIR}/etc/apt/apt.conf.d/00gpgvcmd"
93d0d08c 269}
04937adc 270
93d0d08c 271setupgpgcommand() {
19fdf93d
DK
272 local GPGEXE;
273 if command dpkg -l gnupg1 2>&1 | grep -q '^ii'; then
274 if [ "$1" = '1' ]; then
275 GPGEXE='gpg1'
276 else
277 GPGEXE='gpg'
278 fi
279 else
280 if [ "$1" = '1' ]; then
281 GPGEXE='gpg'
282 else
283 GPGEXE='gpg2'
284 fi
285 fi
286 msgmsg 'Force tests to be run with' "$GPGEXE"
287 echo "APT::Key::GPGCommand \"$GPGEXE\";" > "${ROOTDIR}/etc/apt/apt.conf.d/00gpgcmd"
f14cde2c 288 testsuccess aptkey --readonly adv --version
0cfec3ab 289 cp "${ROOTDIR}/tmp/testsuccess.output" "${TMPWORKINGDIRECTORY}/aptkey.version"
19fdf93d 290 testsuccess grep "^gpg (GnuPG) $1\." "${TMPWORKINGDIRECTORY}/aptkey.version"
04937adc
DK
291}
292
0cfec3ab
DK
293# run with default (whatever this is) in current CWD with relative paths
294ROOTDIR="./rootdir"
295KEYDIR="./keys"
93d0d08c 296testrun
0cfec3ab
DK
297
298# run with … and up the game with a strange CWD & absolute paths
299ROOTDIR="${TMPWORKINGDIRECTORY}/rootdir"
300KEYDIR="${TMPWORKINGDIRECTORY}/keys"
301mkdir inaccessible
302cd inaccessible
303chmod 600 ../inaccessible
304testfilestats "${TMPWORKINGDIRECTORY}/inaccessible" '%a' '=' '600'
305
19fdf93d 306setupgpgcommand '1'
93d0d08c 307testrun
19fdf93d 308setupgpgcommand '2'
93d0d08c 309testrun