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