]>
git.saurik.com Git - apt.git/blob - test/integration/test-apt-key
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 key which exists, but isn't in the" 'forced keyring'
42 testsuccess
--nomsg aptkey
--fakeroot --keyring rootdir
/etc
/apt
/trusted.gpg del DBAC8DAE
44 aptkey list
| grep '^pub' > aptkey.list
45 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18'
47 testsuccess aptkey
--fakeroot del DBAC8DAE
50 # start from a clean plate again
52 rm -rf rootdir
/etc
/apt
/trusted.gpg.d
/ rootdir
/etc
/apt
/trusted.gpg
53 mkdir rootdir
/etc
/apt
/trusted.gpg.d
/
56 msgtest
'Test key removal with' 'single key in real file'
58 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
59 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
61 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
62 testsuccess
cmp keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
64 msgtest
'Test key removal with' 'single key in softlink'
66 ln -s $(readlink -f ./keys/joesixpack.pub) rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
67 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
69 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
70 testsuccess
test -L rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
73 testsuccess aptkey
--fakeroot add .
/keys
/joesixpack.pub
74 testsuccess aptkey
--fakeroot add .
/keys
/marvinparanoid.pub
75 aptkey list
| grep '^pub' > aptkey.list
76 testfileequal .
/aptkey.list
'pub 2048R/DBAC8DAE 2010-08-18
77 pub 2048R/528144E2 2011-01-16'
78 cp -a rootdir
/etc
/apt
/trusted.gpg keys
/testcase
-multikey.pub
# store for reuse
80 msgtest
'Test key removal with' 'multi key in real file'
82 cp -a keys
/testcase
-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
83 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
84 aptkey list
| grep '^pub' > aptkey.list
85 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
86 testsuccess
cmp keys
/testcase
-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
88 msgtest
'Test key removal with' 'multi key in softlink'
90 ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
91 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
92 aptkey list
| grep '^pub' > aptkey.list
93 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
94 testsuccess
cmp keys
/testcase
-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
95 testsuccess
test ! -L rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
96 testsuccess
test -L rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~
98 msgtest
'Test key removal with' 'multiple files including key'
100 cp -a keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
101 cp -a keys
/testcase
-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg
102 testsuccess
--nomsg aptkey
--fakeroot del DBAC8DAE
103 aptkey list
| grep '^pub' > aptkey.list
104 testfileequal .
/aptkey.list
'pub 2048R/528144E2 2011-01-16'
105 testsuccess
test ! -e rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
106 testsuccess
cmp keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg~
107 testsuccess
cmp keys
/testcase
-multikey.pub rootdir
/etc
/apt
/trusted.gpg.d
/multikey.gpg~