]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-596498-trusted-unsigned-repo
avoid using global PendingError to avoid failing too often too soon
[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
11setupaptarchive
12
13aptgetupdate() {
14 rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
15 ${1:-testwarning} aptget update --allow-insecure-repositories
16}
17
18PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)"
19DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)"
20PKGTEXT="$(echo "$PKGTEXT" | head -n 7)"
21DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list'
22
23testsuccessequal "$PKGTEXT
24$DOWNLOG
25Download complete and in download only mode" aptget install cool --assume-no -d
26
27testsuccessequal "$PKGTEXT
28$DOWNLOG
29Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
30
31sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
32aptgetupdate 'testsuccess'
33
34testfailureequal "$PKGTEXT
35WARNING: The following packages cannot be authenticated!
36 cool
37Install these packages without verification? [y/N] N
38E: Some packages could not be authenticated" aptget install cool --assume-no -d
39
40configarchitecture 'amd64' 'i386'
41testequal "$(echo "$PKGTEXT" | sed 's#cool$#cool:i386#g')
42WARNING: The following packages cannot be authenticated!
43 cool:i386
44Authentication warning overridden.
45$DOWNLOG
46Download complete and in download only mode" aptget install cool:i386 --assume-no -d --allow-unauthenticated
47configarchitecture 'i386'
48
49find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
50sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE
51aptgetupdate
52
53testfailureequal "$PKGTEXT
54WARNING: The following packages cannot be authenticated!
55 cool
56Install these packages without verification? [y/N] N
57E: Some packages could not be authenticated" aptget install cool --assume-no -d
58
59testsuccessequal "$PKGTEXT
60WARNING: The following packages cannot be authenticated!
61 cool
62Authentication warning overridden.
63$DOWNLOG
64Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
65
66sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE
67aptgetupdate
68
69testsuccessequal "$PKGTEXT
70$DOWNLOG
71Download complete and in download only mode" aptget install cool --assume-no -d