]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-key-net-update
show more details for "Writing more data" errors, too
[apt.git] / test / integration / test-apt-key-net-update
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture "i386"
9 changetowebserver
10
11 # setup env
12 mkdir -p var/lib/apt/keyrings
13 mkdir -p usr/share/keyrings
14
15 # install the fake master keyring
16 install -m0644 keys/test-master-keyring.pub usr/share/keyrings
17 echo "APT::Key::MasterKeyring \"${TMPWORKINGDIRECTORY}/usr/share/keyrings/test-master-keyring.pub\";" >> ./aptconfig.conf
18
19 # setup archive-keyring
20 mkdir -p aptarchive/ubuntu/project
21 install -m0644 keys/test-archive-keyring.pub aptarchive/ubuntu/project/
22 echo "APT::Key::ArchiveKeyringURI \"http://localhost:${APTHTTPPORT}/ubuntu/project/test-archive-keyring.pub\";" >> ./aptconfig.conf
23 echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
24
25 # test against the "real" webserver
26 testsuccess aptkey --fakeroot net-update
27 testequalor2 'Checking for new archive signing keys now
28 gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
29 gpg: Total number processed: 1
30 gpg: imported: 1 (RSA: 1)' 'Checking for new archive signing keys now
31 gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
32 gpg: Total number processed: 1
33 gpg: imported: 1' cat rootdir/tmp/testsuccess.output
34
35 testaptkeys 'oldarchive' 'newarchive'
36
37 # now try a different one
38 # setup archive-keyring
39 mkdir -p aptarchive/ubuntu/project
40 install -m0644 keys/marvinparanoid.pub aptarchive/ubuntu/project/
41 echo "APT::Key::ArchiveKeyringURI \"http://localhost:${APTHTTPPORT}/ubuntu/project/marvinparanoid.pub\";" >> ./aptconfig.conf
42 echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
43
44 # test against the "real" webserver
45 testsuccessequal "Checking for new archive signing keys now
46 Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
47
48 testaptkeys 'oldarchive' 'newarchive'