]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-key-net-update
test-apt-update-reporting: Make more use of framework
[apt.git] / test / integration / test-apt-key-net-update
CommitLineData
f87338d2
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
f87338d2
DK
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
785cb6fc 19# setup archive-keyring
e5543ea5
MV
20mkdir -p aptarchive/ubuntu/project
21install -m0644 keys/test-archive-keyring.pub aptarchive/ubuntu/project/
6c0765c0 22echo "APT::Key::ArchiveKeyringURI \"http://localhost:${APTHTTPPORT}/ubuntu/project/test-archive-keyring.pub\";" >> ./aptconfig.conf
e5543ea5 23echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
f87338d2 24
e5543ea5 25# test against the "real" webserver
785cb6fc
DK
26testsuccess aptkey --fakeroot net-update
27testequalor2 'Checking for new archive signing keys now
e5543ea5
MV
28gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
29gpg: Total number processed: 1
785cb6fc
DK
30gpg: imported: 1 (RSA: 1)' 'Checking for new archive signing keys now
31gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
32gpg: Total number processed: 1
33gpg: imported: 1' cat rootdir/tmp/testsuccess.output
f87338d2 34
785cb6fc 35testaptkeys 'oldarchive' 'newarchive'
f87338d2 36
e5543ea5 37# now try a different one
785cb6fc 38# setup archive-keyring
e5543ea5
MV
39mkdir -p aptarchive/ubuntu/project
40install -m0644 keys/marvinparanoid.pub aptarchive/ubuntu/project/
6c0765c0 41echo "APT::Key::ArchiveKeyringURI \"http://localhost:${APTHTTPPORT}/ubuntu/project/marvinparanoid.pub\";" >> ./aptconfig.conf
e5543ea5 42echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
f87338d2 43
e5543ea5 44# test against the "real" webserver
25b86db1 45testsuccessequal "Checking for new archive signing keys now
ba72845c 46Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
f87338d2 47
785cb6fc 48testaptkeys 'oldarchive' 'newarchive'