4 TESTDIR
=$
(readlink
-f $
(dirname $0))
8 configarchitecture
'amd64'
10 msgtest
'Check that paths in list output are not' 'double-slashed'
11 aptkey list
2>&1 |
grep -q '//' && msgfail || msgpass
13 msgtest
'Check that paths in finger output are not' 'double-slashed'
14 aptkey
finger 2>&1 |
grep -q '//' && msgfail || msgpass
16 echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub";
17 APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir
/etc
/apt
/apt.conf.d
/aptkey.conf
19 aptkey list |
grep '^pub' > aptkey.list
20 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18'
22 testequal
'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
23 gpg: Total number processed: 1
24 gpg: unchanged: 1' aptkey
--fakeroot update
26 aptkey list |
grep '^pub' > aptkey.list
27 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18'
29 testsuccess aptkey
--fakeroot add .
/keys
/rexexpired.pub
31 aptkey list |
grep '^pub' > aptkey.list
32 testfileequal .
/aptkey.list
'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
33 pub 2048R/DBAC8DAE 2010-08-18'
35 msgtest
'Execute update again to trigger removal of' 'Rex Expired key'
36 testsuccess
--nomsg aptkey
--fakeroot update
38 aptkey list |
grep '^pub' > aptkey.list
39 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18'
41 msgtest
"Try to remove a" 'nonexistent keyid'
42 testfailure
--nomsg aptkey
--fakeroot --keyring rootdir
/etc
/apt
/trusted.gpg del BOGUSKEY
44 aptkey list |
grep '^pub' > aptkey2.list
45 testsuccess
diff .
/aptkey.list .
/aptkey2.list
47 msgtest
"Try to remove a key which exists, but isn't in the" 'forced keyring'
48 testsuccess
--nomsg aptkey
--fakeroot --keyring rootdir
/etc
/apt
/trusted.gpg del DBAC8DAE
50 aptkey list |
grep '^pub' > aptkey.list
51 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18'
53 testsuccess aptkey
--fakeroot del DBAC8DAE
56 # start from a clean plate again
58 rm -rf rootdir
/etc
/apt
/trusted.gpg.d
/ rootdir
/etc
/apt
/trusted.gpg
59 mkdir rootdir
/etc
/apt
/trusted.gpg.d
/
62 msgtest
'Test key removal with' 'single key in real file'
64 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
65 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
67 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
68 testsuccess
cmp keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
70 msgtest
'Test key removal with' 'lowercase keyid'
72 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
73 testsuccess
--nomsg aptkey
--fakeroot del dbac8dae
75 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
76 testsuccess
cmp keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
78 msgtest
'Test key removal with' 'single key in softlink'
80 ln -s $
(readlink
-f .
/keys
/joesixpack.pub
) rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
81 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
83 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
84 testsuccess
test -L rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
87 testsuccess aptkey
--fakeroot add .
/keys
/joesixpack.pub
88 testsuccess aptkey
--fakeroot add .
/keys
/marvinparanoid.pub
89 aptkey list |
grep '^pub' > aptkey.list
90 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18
91 pub 2048R/528144E2 2011-01-16'
92 cp -a rootdir
/etc
/apt
/trusted.gpg keys
/testcase-multikey.pub
# store for reuse
94 msgtest
'Test key removal with' 'multi key in real file'
96 cp -a keys
/testcase-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
97 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
98 aptkey list |
grep '^pub' > aptkey.list
99 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
100 testsuccess
cmp keys
/testcase-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
102 msgtest
'Test key removal with' 'multi key in softlink'
104 ln -s $
(readlink
-f .
/keys
/testcase-multikey.pub
) rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
105 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
106 aptkey list |
grep '^pub' > aptkey.list
107 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
108 testsuccess
cmp keys
/testcase-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
109 testsuccess
test ! -L rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
110 testsuccess
test -L rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
112 msgtest
'Test key removal with' 'multiple files including key'
114 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
115 cp -a keys
/testcase-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
116 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
117 aptkey list |
grep '^pub' > aptkey.list
118 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
119 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
120 testsuccess
cmp keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
121 testsuccess
cmp keys
/testcase-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
123 msgtest
'Test key removal with' '8 byte key ID'
125 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
126 testsuccess
--nomsg aptkey
--fakeroot del
5A90D141DBAC8DAE
127 testempty aptkey list