]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-596498-trusted-unsigned-repo
fix testcase expecting incorrect remove log from dpkg
[apt.git] / test / integration / test-bug-596498-trusted-unsigned-repo
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'i386'
8
9buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
10
11msgmsg 'default setup'
12setupaptarchive
13
14aptgetupdate() {
15 rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
16 ${1:-testwarning} aptget update --allow-insecure-repositories
17}
18
19PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)"
20DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)"
21PKGTEXT="$(echo "$PKGTEXT" | head -n 7)"
22DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list'
23
24testsuccessequal "$PKGTEXT
25$DOWNLOG
26Download complete and in download only mode" aptget install cool --assume-no -d
27
28testsuccessequal "$PKGTEXT
29$DOWNLOG
30Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
31
32msgmsg 'sources marked trusted=no'
33sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
34aptgetupdate 'testsuccess'
35
36testfailureequal "$PKGTEXT
37WARNING: The following packages cannot be authenticated!
38 cool
39Install these packages without verification? [y/N] N
40E: Some packages could not be authenticated" aptget install cool --assume-no -d
41
42configarchitecture 'amd64' 'i386'
43testequal "$(echo "$PKGTEXT" | sed 's#cool$#cool:i386#g')
44WARNING: The following packages cannot be authenticated!
45 cool:i386
46Authentication warning overridden.
47$DOWNLOG
48Download complete and in download only mode" aptget install cool:i386 --assume-no -d --allow-unauthenticated
49configarchitecture 'i386'
50
51find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
52msgmsg 'unsigned repo'
53sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE
54aptgetupdate
55
56testfailureequal "$PKGTEXT
57WARNING: The following packages cannot be authenticated!
58 cool
59Install these packages without verification? [y/N] N
60E: Some packages could not be authenticated" aptget install cool --assume-no -d
61
62testsuccessequal "$PKGTEXT
63WARNING: The following packages cannot be authenticated!
64 cool
65Authentication warning overridden.
66$DOWNLOG
67Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
68
69msgmsg 'sources marked trusted=yes'
70sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE
71aptgetupdate 'testsuccess'
72
73testsuccessequal "$PKGTEXT
74$DOWNLOG
75Download complete and in download only mode" aptget install cool --assume-no -d