]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-596498-trusted-unsigned-repo
bring back deb822 sources.list entries as .sources
[apt.git] / test / integration / test-bug-596498-trusted-unsigned-repo
CommitLineData
4b42f43b
DK
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
4fa34122 15 ${1:-testwarning} aptget update --allow-insecure-repositories
4b42f43b
DK
16}
17
ff86d7df
DK
18PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)"
19DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)"
20PKGTEXT="$(echo "$PKGTEXT" | head -n 7)"
4b42f43b
DK
21DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list'
22
25b86db1 23testsuccessequal "$PKGTEXT
ff86d7df 24$DOWNLOG
4b42f43b
DK
25Download complete and in download only mode" aptget install cool --assume-no -d
26
25b86db1 27testsuccessequal "$PKGTEXT
ff86d7df 28$DOWNLOG
6c34ccca
DK
29Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
30
4b42f43b 31sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE
4fa34122 32aptgetupdate 'testsuccess'
4b42f43b 33
25b86db1 34testfailureequal "$PKGTEXT
4b42f43b
DK
35WARNING: The following packages cannot be authenticated!
36 cool
55732492 37Install these packages without verification? [y/N] N
4b42f43b
DK
38E: Some packages could not be authenticated" aptget install cool --assume-no -d
39
40find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
41sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
42aptgetupdate
43
25b86db1 44testfailureequal "$PKGTEXT
4b42f43b
DK
45WARNING: The following packages cannot be authenticated!
46 cool
55732492 47Install these packages without verification? [y/N] N
4b42f43b
DK
48E: Some packages could not be authenticated" aptget install cool --assume-no -d
49
25b86db1 50testsuccessequal "$PKGTEXT
6c34ccca
DK
51WARNING: The following packages cannot be authenticated!
52 cool
53Authentication warning overridden.
ff86d7df 54$DOWNLOG
6c34ccca
DK
55Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
56
4b42f43b
DK
57sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE
58aptgetupdate
59
25b86db1 60testsuccessequal "$PKGTEXT
ff86d7df 61$DOWNLOG
4b42f43b 62Download complete and in download only mode" aptget install cool --assume-no -d