]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # ensure we print warnings for unauthenticated repositories | |
4 | # | |
5 | set -e | |
6 | ||
7 | TESTDIR=$(readlink -f $(dirname $0)) | |
8 | . $TESTDIR/framework | |
9 | ||
10 | setupenvironment | |
11 | configarchitecture "i386" | |
12 | configcompression '.' 'gz' | |
13 | ||
14 | # a "normal" package with source and binary | |
15 | buildsimplenativepackage 'foo' 'all' '2.0' | |
16 | ||
17 | setupaptarchive --no-update | |
18 | ||
19 | APTARCHIVE=$(readlink -f ./aptarchive) | |
20 | rm -f $APTARCHIVE/dists/unstable/*Release* | |
21 | ||
22 | # update without authenticated files leads to warning | |
23 | testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease | |
24 | File not found | |
25 | Err:2 file:$APTARCHIVE unstable Release | |
26 | File not found | |
27 | W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. | |
28 | E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories | |
29 | ||
30 | # no package foo | |
31 | testsuccessequal 'Listing...' apt list foo | |
32 | testequal 'lock | |
33 | partial' ls rootdir/var/lib/apt/lists | |
34 | ||
35 | filesize() { | |
36 | stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" | |
37 | } | |
38 | # allow override | |
39 | testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease | |
40 | File not found | |
41 | Ign:2 file:$APTARCHIVE unstable Release | |
42 | File not found | |
43 | Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] | |
44 | Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] | |
45 | Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] | |
46 | Reading package lists... | |
47 | W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories | |
48 | # ensure we can not install the package | |
49 | testfailureequal "WARNING: The following packages cannot be authenticated! | |
50 | foo | |
51 | E: There are problems and -y was used without --force-yes" aptget install -qq -y foo |