]>
Commit | Line | Data |
---|---|---|
4b42f43b DK |
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 | |
4fa34122 | 15 | ${1:-testwarning} aptget update --allow-insecure-repositories |
4b42f43b DK |
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 | ||
25b86db1 | 21 | testsuccessequal "$PKGTEXT |
4b42f43b DK |
22 | Download complete and in download only mode" aptget install cool --assume-no -d |
23 | ||
25b86db1 | 24 | testsuccessequal "$PKGTEXT |
6c34ccca DK |
25 | Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated |
26 | ||
4b42f43b | 27 | sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE |
4fa34122 | 28 | aptgetupdate 'testsuccess' |
4b42f43b | 29 | |
25b86db1 | 30 | testfailureequal "$PKGTEXT |
4b42f43b DK |
31 | WARNING: The following packages cannot be authenticated! |
32 | cool | |
55732492 | 33 | Install these packages without verification? [y/N] N |
4b42f43b DK |
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 | ||
25b86db1 | 40 | testfailureequal "$PKGTEXT |
4b42f43b DK |
41 | WARNING: The following packages cannot be authenticated! |
42 | cool | |
55732492 | 43 | Install these packages without verification? [y/N] N |
4b42f43b DK |
44 | E: Some packages could not be authenticated" aptget install cool --assume-no -d |
45 | ||
25b86db1 | 46 | testsuccessequal "$PKGTEXT |
6c34ccca DK |
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 | ||
4b42f43b DK |
52 | sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE |
53 | aptgetupdate | |
54 | ||
25b86db1 | 55 | testsuccessequal "$PKGTEXT |
4b42f43b | 56 | Download complete and in download only mode" aptget install cool --assume-no -d |