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