]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-key-net-update
Merge branch 'debian/sid' into debian/experimental
[apt.git] / test / integration / test-apt-key-net-update
CommitLineData
f87338d2
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
5acf154d
MV
9changetowebserver
10
11# setup env
e5543ea5
MV
12mkdir -p var/lib/apt/keyrings
13mkdir -p usr/share/keyrings
f87338d2 14
e5543ea5
MV
15# install the fake master keyring
16install -m0644 keys/test-master-keyring.pub usr/share/keyrings
17echo "APT::Key::MasterKeyring \"${TMPWORKINGDIRECTORY}/usr/share/keyrings/test-master-keyring.pub\";" >> ./aptconfig.conf
f87338d2 18
e5543ea5
MV
19# setup archive-keyring
20mkdir -p aptarchive/ubuntu/project
21install -m0644 keys/test-archive-keyring.pub aptarchive/ubuntu/project/
22echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/test-archive-keyring.pub";' >> ./aptconfig.conf
23echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
f87338d2 24
e5543ea5
MV
25# test against the "real" webserver
26testequal 'Checking for new archive signing keys now
27gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
28gpg: Total number processed: 1
29gpg: imported: 1 (RSA: 1)' aptkey --fakeroot net-update
f87338d2 30
12841e83
DK
31aptkey list | grep '^pub' > aptkey.list
32testfileequal ./aptkey.list 'pub 1024R/F68C85A3 2013-12-19
33pub 2048R/DBAC8DAE 2010-08-18'
f87338d2 34
e5543ea5
MV
35# now try a different one
36# setup archive-keyring
37mkdir -p aptarchive/ubuntu/project
38install -m0644 keys/marvinparanoid.pub aptarchive/ubuntu/project/
39echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/marvinparanoid.pub";' >> ./aptconfig.conf
40echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
f87338d2 41
e5543ea5
MV
42# test against the "real" webserver
43testequal "Checking for new archive signing keys now
ba72845c 44Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
f87338d2 45
12841e83
DK
46aptkey list | grep '^pub' > aptkey.list
47testfileequal ./aptkey.list 'pub 1024R/F68C85A3 2013-12-19
48pub 2048R/DBAC8DAE 2010-08-18'