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