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