]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-key-net-update
add apt-key support for armored GPG key files (*.asc)
[apt.git] / test / integration / test-apt-key-net-update
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture "i386"
9changetowebserver
10
11# setup env
12mkdir -p var/lib/apt/keyrings
13mkdir -p usr/share/keyrings
14
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
18
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:${APTHTTPPORT}/ubuntu/project/test-archive-keyring.pub\";" >> ./aptconfig.conf
23echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
24
25# test against the "real" webserver
26testsuccess aptkey --fakeroot net-update
27testfailure grep 'not added' rootdir/tmp/testsuccess.output
28testaptkeys 'oldarchive' 'newarchive'
29
30# now try a different one
31# setup archive-keyring
32mkdir -p aptarchive/ubuntu/project
33install -m0644 keys/marvinparanoid.pub aptarchive/ubuntu/project/
34echo "APT::Key::ArchiveKeyringURI \"http://localhost:${APTHTTPPORT}/ubuntu/project/marvinparanoid.pub\";" >> ./aptconfig.conf
35echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
36
37# test against the "real" webserver
38testsuccessequal "Checking for new archive signing keys now
39Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
40
41testaptkeys 'oldarchive' 'newarchive'