prepare 1.0.4 upload
[ntk/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 aptget update -qq
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 testequal "$PKGTEXT
22 Download complete and in download only mode" aptget install cool --assume-no -d
23
24 testequal "$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
29
30 testequal "$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 testequal "$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 testequal "$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 testequal "$PKGTEXT
56 Download complete and in download only mode" aptget install cool --assume-no -d