summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-838779-untrusted-to-trusted-Release-hit
blob: 50234753bb69cf113c971fae88393e4d9d55a030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'

buildsimplenativepackage 'foo' 'all' '1' 'stable'

export APT_DONT_SIGN=''
setupaptarchive --no-update

changetowebserver

testsuccess aptget update
testdpkgnotinstalled 'foo'
testsuccess apt install foo -y
testdpkginstalled 'foo'
testsuccess apt purge foo -y
testdpkgnotinstalled 'foo'

msgmsg 'Untrusted to trusted hit' 'InRelease'
rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
mv rootdir/etc/apt/trusted.gpg.d rootdir/etc/apt/trusted.gpg.d-bak
testfailure aptget update
testwarning aptget update --allow-insecure-repositories
testfailure apt install foo -y
testdpkgnotinstalled 'foo'
mv rootdir/etc/apt/trusted.gpg.d-bak rootdir/etc/apt/trusted.gpg.d
testsuccess aptget update
testsuccess apt install foo -y
testdpkginstalled 'foo'
testsuccess apt purge foo -y
testdpkgnotinstalled 'foo'

msgmsg 'Untrusted to trusted hit' 'Release.gpg'
find aptarchive -name 'InRelease' -delete
rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
mv rootdir/etc/apt/trusted.gpg.d rootdir/etc/apt/trusted.gpg.d-bak
testfailure aptget update
testwarning aptget update --allow-insecure-repositories
testfailure apt install foo -y
testdpkgnotinstalled 'foo'
mv rootdir/etc/apt/trusted.gpg.d-bak rootdir/etc/apt/trusted.gpg.d
testsuccess aptget update
testsuccess apt install foo -y
testdpkginstalled 'foo'