]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-key
5beb6f22065d366a8cd57fca723388b7a545abad
[apt.git] / test / integration / test-apt-key
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6
7 setupenvironment
8 configarchitecture 'amd64'
9
10 msgtest 'Check that paths in list output are not' 'double-slashed'
11 aptkey list 2>&1 | grep -q '//' && msgfail || msgpass
12
13 msgtest 'Check that paths in finger output are not' 'double-slashed'
14 aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass
15
16 echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub";
17 APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/aptkey.conf
18
19 aptkey list | grep '^pub' > aptkey.list
20 testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
21
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
25
26 aptkey list | grep '^pub' > aptkey.list
27 testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
28
29 testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
30
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'
34
35 msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
36 testsuccess --nomsg aptkey --fakeroot update
37
38 aptkey list | grep '^pub' > aptkey.list
39 testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'