summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-key
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-09-01 00:53:40 +0200
committerJulian Andres Klode <jak@debian.org>2016-09-01 00:53:40 +0200
commit265c3312bd1b329dc9b54c754da46621d9019c11 (patch)
treee1c740747f84f793ee2b6ab4ffaffbc9f76cd575 /test/integration/test-apt-key
parent28f0867d99398a23296ead313112402c51d4e876 (diff)
parent317bb39f3cd6626c74f25d7bdf2907f1b235f553 (diff)
Merge tag '1.3_rc3' into ubuntu/master
apt Debian release 1.3~rc3
Diffstat (limited to 'test/integration/test-apt-key')
-rwxr-xr-xtest/integration/test-apt-key24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key
index 759ce1487..96cfe41fa 100755
--- a/test/integration/test-apt-key
+++ b/test/integration/test-apt-key
@@ -81,6 +81,20 @@ gpg: unchanged: 1' aptkey --fakeroot update
testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
testempty aptkey list
+ if [ "$(id -u)" != '0' ]; then
+ msgtest 'Test key removal with' 'unreadable key'
+ cleanplate
+ cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
+ echo 'foobar' > "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ chmod 000 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ testwarning --nomsg aptkey --fakeroot del d141dbac8dae
+ testwarning aptkey list
+ chmod 644 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ rm -f "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ grep -v '^W: ' "${ROOTDIR}/tmp/testwarning.output" > "${ROOTDIR}/aptkeylist.output" || true
+ testempty cat "${ROOTDIR}/aptkeylist.output"
+ fi
+
msgtest 'Test key removal with' 'single key in real file'
cleanplate
cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
@@ -202,6 +216,16 @@ gpg: unchanged: 1' aptkey --fakeroot update
msgtest 'Test verify a file' 'with all keys'
testsuccess --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+ if [ "$(id -u)" != '0' ]; then
+ msgtest 'Test verify a file' 'with unreadable key'
+ echo 'foobar' > "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ chmod 000 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ testwarning --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+ testwarning aptkey list
+ chmod 644 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ rm -f "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ fi
+
msgtest 'Test verify a file' 'with good keyring'
testsuccess --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"