]>
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 | ||
ff86d7df DK |
18 | PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" |
19 | DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" | |
20 | PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" | |
268ffceb | 21 | DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list' |
4b42f43b | 22 | |
25b86db1 | 23 | testsuccessequal "$PKGTEXT |
ff86d7df | 24 | $DOWNLOG |
4b42f43b DK |
25 | Download complete and in download only mode" aptget install cool --assume-no -d |
26 | ||
25b86db1 | 27 | testsuccessequal "$PKGTEXT |
ff86d7df | 28 | $DOWNLOG |
6c34ccca DK |
29 | Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated |
30 | ||
268ffceb | 31 | sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE |
4fa34122 | 32 | aptgetupdate 'testsuccess' |
4b42f43b | 33 | |
25b86db1 | 34 | testfailureequal "$PKGTEXT |
4b42f43b DK |
35 | WARNING: The following packages cannot be authenticated! |
36 | cool | |
55732492 | 37 | Install these packages without verification? [y/N] N |
4b42f43b DK |
38 | E: Some packages could not be authenticated" aptget install cool --assume-no -d |
39 | ||
a0c19a21 DK |
40 | configarchitecture 'amd64' 'i386' |
41 | testequal "$(echo "$PKGTEXT" | sed 's#cool$#cool:i386#g') | |
42 | WARNING: The following packages cannot be authenticated! | |
43 | cool:i386 | |
44 | Authentication warning overridden. | |
45 | $DOWNLOG | |
46 | Download complete and in download only mode" aptget install cool:i386 --assume-no -d --allow-unauthenticated | |
47 | configarchitecture 'i386' | |
48 | ||
4b42f43b | 49 | find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete |
268ffceb | 50 | sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE |
4b42f43b DK |
51 | aptgetupdate |
52 | ||
25b86db1 | 53 | testfailureequal "$PKGTEXT |
4b42f43b DK |
54 | WARNING: The following packages cannot be authenticated! |
55 | cool | |
55732492 | 56 | Install these packages without verification? [y/N] N |
4b42f43b DK |
57 | E: Some packages could not be authenticated" aptget install cool --assume-no -d |
58 | ||
25b86db1 | 59 | testsuccessequal "$PKGTEXT |
6c34ccca DK |
60 | WARNING: The following packages cannot be authenticated! |
61 | cool | |
62 | Authentication warning overridden. | |
ff86d7df | 63 | $DOWNLOG |
6c34ccca DK |
64 | Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated |
65 | ||
268ffceb | 66 | sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE |
4b42f43b DK |
67 | aptgetupdate |
68 | ||
25b86db1 | 69 | testsuccessequal "$PKGTEXT |
ff86d7df | 70 | $DOWNLOG |
4b42f43b | 71 | Download complete and in download only mode" aptget install cool --assume-no -d |