]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-596498-trusted-unsigned-repo
hide Translation-* in 'apt-cache policy' output
[apt.git] / test / integration / test-bug-596498-trusted-unsigned-repo
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386'
8
9 buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
10
11 setupaptarchive
12
13 aptgetupdate() {
14 rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
15 ${1:-testwarning} aptget update --allow-insecure-repositories
16 }
17
18 PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)"
19 DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list'
20
21 testsuccessequal "$PKGTEXT
22 Download complete and in download only mode" aptget install cool --assume-no -d
23
24 testsuccessequal "$PKGTEXT
25 Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
26
27 sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE
28 aptgetupdate 'testsuccess'
29
30 testfailureequal "$PKGTEXT
31 WARNING: The following packages cannot be authenticated!
32 cool
33 Install these packages without verification? [y/N] N
34 E: Some packages could not be authenticated" aptget install cool --assume-no -d
35
36 find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
37 sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
38 aptgetupdate
39
40 testfailureequal "$PKGTEXT
41 WARNING: The following packages cannot be authenticated!
42 cool
43 Install these packages without verification? [y/N] N
44 E: Some packages could not be authenticated" aptget install cool --assume-no -d
45
46 testsuccessequal "$PKGTEXT
47 WARNING: The following packages cannot be authenticated!
48 cool
49 Authentication warning overridden.
50 Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
51
52 sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE
53 aptgetupdate
54
55 testsuccessequal "$PKGTEXT
56 Download complete and in download only mode" aptget install cool --assume-no -d