]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-update-unauth-warning
tests: try to support spaces in TMPDIR
[apt.git] / test / integration / test-apt-get-update-unauth-warning
CommitLineData
c4ffa042
MV
1#!/bin/sh
2#
3# ensure we print warnings for unauthenticated repositories
4#
5set -e
6
7TESTDIR=$(readlink -f $(dirname $0))
8. $TESTDIR/framework
9
10setupenvironment
11configarchitecture "i386"
ff86d7df 12configcompression '.' 'gz'
c4ffa042
MV
13
14# a "normal" package with source and binary
15buildsimplenativepackage 'foo' 'all' '2.0'
16
17setupaptarchive --no-update
18
63c71412
DK
19APTARCHIVE="$(readlink -f ./aptarchive)"
20find "$APTARCHIVE/dists/unstable" -name '*Release*' -delete
c4ffa042 21
bca84917 22# update without authenticated files leads to warning
9d2a8a73
DK
23testfailureequal "Get:1 file:$APTARCHIVE unstable InRelease
24Ign:1 file:$APTARCHIVE unstable InRelease
4dbfe436 25 File not found
9d2a8a73 26Get:2 file:$APTARCHIVE unstable Release
1eb1836f 27Err:2 file:$APTARCHIVE unstable Release
4dbfe436 28 File not found
95278287 29Reading package lists...
1da3b7b8 30W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
68ba0b7f 31E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
bca84917
MV
32
33# no package foo
25b86db1 34testsuccessequal 'Listing...' apt list foo
546dbfc8
DK
35testequal 'lock
36partial' ls rootdir/var/lib/apt/lists
bca84917 37
ff86d7df 38filesize() {
c2a4a8dd 39 stat -c%s "$(aptget indextargets --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz"
ff86d7df 40}
bca84917 41# allow override
9d2a8a73
DK
42#aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1
43#exit
44testwarningequal "Get:1 file:$APTARCHIVE unstable InRelease
45Ign:1 file:$APTARCHIVE unstable InRelease
4dbfe436 46 File not found
9d2a8a73 47Get:2 file:$APTARCHIVE unstable Release
1eb1836f 48Ign:2 file:$APTARCHIVE unstable Release
4dbfe436 49 File not found
9d2a8a73
DK
50Get:3 file:$APTARCHIVE unstable/main Sources
51Ign:3 file:$APTARCHIVE unstable/main Sources
52 File not found
53Get:4 file:$APTARCHIVE unstable/main i386 Packages
54Ign:4 file:$APTARCHIVE unstable/main i386 Packages
55 File not found
56Get:5 file:$APTARCHIVE unstable/main Translation-en
57Ign:5 file:$APTARCHIVE unstable/main Translation-en
58 File not found
59Get:3 file:$APTARCHIVE unstable/main Sources
60Ign:3 file:$APTARCHIVE unstable/main Sources
61 File not found
62Get:4 file:$APTARCHIVE unstable/main i386 Packages
63Ign:4 file:$APTARCHIVE unstable/main i386 Packages
64 File not found
65Get:5 file:$APTARCHIVE unstable/main Translation-en
66Ign:5 file:$APTARCHIVE unstable/main Translation-en
67 File not found
68Get:3 file:$APTARCHIVE unstable/main Sources
69Ign:3 file:$APTARCHIVE unstable/main Sources
70 File not found
71Get:4 file:$APTARCHIVE unstable/main i386 Packages
72Ign:4 file:$APTARCHIVE unstable/main i386 Packages
73 File not found
74Get:5 file:$APTARCHIVE unstable/main Translation-en
75Ign:5 file:$APTARCHIVE unstable/main Translation-en
76 File not found
1eb1836f
DK
77Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B]
78Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B]
79Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
bca84917 80Reading package lists...
1da3b7b8 81W: 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 82# ensure we can not install the package
25b86db1 83testfailureequal "WARNING: The following packages cannot be authenticated!
c4ffa042 84 foo
b381a482 85E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y foo