]>
Commit | Line | Data |
---|---|---|
c4ffa042 MV |
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" | |
ff86d7df | 12 | configcompression '.' 'gz' |
c4ffa042 MV |
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 | ||
bca84917 | 22 | # update without authenticated files leads to warning |
1eb1836f | 23 | testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease |
4dbfe436 | 24 | File not found |
1eb1836f | 25 | Err:2 file:$APTARCHIVE unstable Release |
4dbfe436 | 26 | File not found |
1da3b7b8 | 27 | W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. |
68ba0b7f | 28 | E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories |
bca84917 MV |
29 | |
30 | # no package foo | |
25b86db1 | 31 | testsuccessequal 'Listing...' apt list foo |
546dbfc8 DK |
32 | testequal 'lock |
33 | partial' ls rootdir/var/lib/apt/lists | |
bca84917 | 34 | |
ff86d7df DK |
35 | filesize() { |
36 | stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" | |
37 | } | |
bca84917 | 38 | # allow override |
1eb1836f | 39 | testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease |
4dbfe436 | 40 | File not found |
1eb1836f | 41 | Ign:2 file:$APTARCHIVE unstable Release |
4dbfe436 | 42 | File not found |
1eb1836f DK |
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] | |
bca84917 | 46 | Reading package lists... |
1da3b7b8 | 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 |
c4ffa042 | 48 | # ensure we can not install the package |
25b86db1 | 49 | testfailureequal "WARNING: The following packages cannot be authenticated! |
c4ffa042 MV |
50 | foo |
51 | E: There are problems and -y was used without --force-yes" aptget install -qq -y foo |