]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-update-unauth-warning
show item ID in Hit, Ign and Err lines as well
[apt.git] / test / integration / test-apt-get-update-unauth-warning
... / ...
CommitLineData
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"
12configcompression '.' 'gz'
13
14# a "normal" package with source and binary
15buildsimplenativepackage 'foo' 'all' '2.0'
16
17setupaptarchive --no-update
18
19APTARCHIVE=$(readlink -f ./aptarchive)
20rm -f $APTARCHIVE/dists/unstable/*Release*
21
22# update without authenticated files leads to warning
23testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease
24 File not found
25Err:2 file:$APTARCHIVE unstable Release
26 File not found
27W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
28E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
29
30# no package foo
31testsuccessequal 'Listing...' apt list foo
32testequal 'lock
33partial' ls rootdir/var/lib/apt/lists
34
35filesize() {
36 stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz"
37}
38# allow override
39testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease
40 File not found
41Ign:2 file:$APTARCHIVE unstable Release
42 File not found
43Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B]
44Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B]
45Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
46Reading package lists...
47W: 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
49testfailureequal "WARNING: The following packages cannot be authenticated!
50 foo
51E: There are problems and -y was used without --force-yes" aptget install -qq -y foo