]>
Commit | Line | Data |
---|---|---|
c4ffa042 MV |
1 | #!/bin/sh |
2 | # | |
3 | # ensure we print warnings for unauthenticated repositories | |
4 | # | |
5 | set -e | |
6 | ||
3abb6a6a DK |
7 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
8 | . "$TESTDIR/framework" | |
c4ffa042 MV |
9 | |
10 | setupenvironment | |
11 | configarchitecture "i386" | |
ff86d7df | 12 | configcompression '.' 'gz' |
c4ffa042 | 13 | |
f01f5d91 DK |
14 | echo 'Acquire::Progress::Ignore::ShowErrorText "false";' > rootdir/etc/apt/apt.conf.d/99show-no-ignore-errors.conf |
15 | ||
c4ffa042 MV |
16 | # a "normal" package with source and binary |
17 | buildsimplenativepackage 'foo' 'all' '2.0' | |
18 | ||
19 | setupaptarchive --no-update | |
20 | ||
63c71412 | 21 | APTARCHIVE="$(readlink -f ./aptarchive)" |
f01f5d91 DK |
22 | find "$APTARCHIVE/dists/unstable" \( -name 'InRelease' -o -name 'Release.gpg' \) -delete |
23 | sed -i -n '/^SHA1:$/q;p' "${APTARCHIVE}/dists/unstable/Release" | |
24 | testwarning aptget update | |
c4ffa042 | 25 | |
30c8107e | 26 | |
f01f5d91 DK |
27 | rm -rf rootdir/var/lib/apt/lists |
28 | find "$APTARCHIVE/dists/unstable" -name '*Release*' -delete | |
bca84917 | 29 | # update without authenticated files leads to warning |
9d2a8a73 DK |
30 | testfailureequal "Get:1 file:$APTARCHIVE unstable InRelease |
31 | Ign:1 file:$APTARCHIVE unstable InRelease | |
9d2a8a73 | 32 | Get:2 file:$APTARCHIVE unstable Release |
1eb1836f | 33 | Err:2 file:$APTARCHIVE unstable Release |
30c8107e | 34 | File not found - ${APTARCHIVE}/dists/unstable/Release (2: No such file or directory) |
95278287 | 35 | Reading package lists... |
f18f2338 | 36 | E: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. |
83960341 | 37 | N: Updating from such a repository can't be done securely, and is therefore disabled by default. |
87d6947d | 38 | N: See apt-secure(8) manpage for repository creation and user configuration details." aptget update --no-allow-insecure-repositories |
bca84917 MV |
39 | |
40 | # no package foo | |
25b86db1 | 41 | testsuccessequal 'Listing...' apt list foo |
546dbfc8 DK |
42 | testequal 'lock |
43 | partial' ls rootdir/var/lib/apt/lists | |
bca84917 | 44 | |
ff86d7df | 45 | filesize() { |
1dd20368 DK |
46 | local CREATEDBY="$1" |
47 | shift | |
48 | stat -c%s "$(aptget indextargets --no-release-info --format '$(URI)' "Created-By: $CREATEDBY" "$@" | cut -d'/' -f 3- ).gz" | |
ff86d7df | 49 | } |
bca84917 | 50 | # allow override |
9d2a8a73 DK |
51 | #aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1 |
52 | #exit | |
53 | testwarningequal "Get:1 file:$APTARCHIVE unstable InRelease | |
54 | Ign:1 file:$APTARCHIVE unstable InRelease | |
9d2a8a73 | 55 | Get:2 file:$APTARCHIVE unstable Release |
1eb1836f | 56 | Ign:2 file:$APTARCHIVE unstable Release |
9d2a8a73 DK |
57 | Get:3 file:$APTARCHIVE unstable/main Sources |
58 | Ign:3 file:$APTARCHIVE unstable/main Sources | |
9d2a8a73 DK |
59 | Get:4 file:$APTARCHIVE unstable/main i386 Packages |
60 | Ign:4 file:$APTARCHIVE unstable/main i386 Packages | |
1dd20368 DK |
61 | Get:5 file:$APTARCHIVE unstable/main all Packages |
62 | Ign:5 file:$APTARCHIVE unstable/main all Packages | |
1dd20368 DK |
63 | Get:6 file:$APTARCHIVE unstable/main Translation-en |
64 | Ign:6 file:$APTARCHIVE unstable/main Translation-en | |
9d2a8a73 DK |
65 | Get:3 file:$APTARCHIVE unstable/main Sources |
66 | Ign:3 file:$APTARCHIVE unstable/main Sources | |
9d2a8a73 DK |
67 | Get:4 file:$APTARCHIVE unstable/main i386 Packages |
68 | Ign:4 file:$APTARCHIVE unstable/main i386 Packages | |
1dd20368 DK |
69 | Get:5 file:$APTARCHIVE unstable/main all Packages |
70 | Ign:5 file:$APTARCHIVE unstable/main all Packages | |
1dd20368 DK |
71 | Get:6 file:$APTARCHIVE unstable/main Translation-en |
72 | Ign:6 file:$APTARCHIVE unstable/main Translation-en | |
9d2a8a73 DK |
73 | Get:3 file:$APTARCHIVE unstable/main Sources |
74 | Ign:3 file:$APTARCHIVE unstable/main Sources | |
9d2a8a73 DK |
75 | Get:4 file:$APTARCHIVE unstable/main i386 Packages |
76 | Ign:4 file:$APTARCHIVE unstable/main i386 Packages | |
1dd20368 DK |
77 | Get:5 file:$APTARCHIVE unstable/main all Packages |
78 | Ign:5 file:$APTARCHIVE unstable/main all Packages | |
1dd20368 DK |
79 | Get:6 file:$APTARCHIVE unstable/main Translation-en |
80 | Ign:6 file:$APTARCHIVE unstable/main Translation-en | |
1eb1836f | 81 | Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] |
1dd20368 DK |
82 | Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages' 'Architecture: i386') B] |
83 | Get:5 file:$APTARCHIVE unstable/main all Packages [$(filesize 'Packages' 'Architecture: all') B] | |
84 | Get:6 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] | |
bca84917 | 85 | Reading package lists... |
f18f2338 | 86 | W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. |
d04e44ac | 87 | N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. |
87d6947d | 88 | N: See apt-secure(8) manpage for repository creation and user configuration details." aptget update --allow-insecure-repositories |
c4ffa042 | 89 | # ensure we can not install the package |
25b86db1 | 90 | testfailureequal "WARNING: The following packages cannot be authenticated! |
c4ffa042 | 91 | foo |
b381a482 | 92 | E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y foo |