]> git.saurik.com Git - apt.git/blame - 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
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
19APTARCHIVE=$(readlink -f ./aptarchive)
20rm -f $APTARCHIVE/dists/unstable/*Release*
21
bca84917 22# update without authenticated files leads to warning
1eb1836f 23testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease
4dbfe436 24 File not found
1eb1836f 25Err:2 file:$APTARCHIVE unstable Release
4dbfe436 26 File not found
1da3b7b8 27W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
68ba0b7f 28E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
bca84917
MV
29
30# no package foo
25b86db1 31testsuccessequal 'Listing...' apt list foo
546dbfc8
DK
32testequal 'lock
33partial' ls rootdir/var/lib/apt/lists
bca84917 34
ff86d7df
DK
35filesize() {
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 39testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease
4dbfe436 40 File not found
1eb1836f 41Ign:2 file:$APTARCHIVE unstable Release
4dbfe436 42 File not found
1eb1836f
DK
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]
bca84917 46Reading package lists...
1da3b7b8 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
c4ffa042 48# ensure we can not install the package
25b86db1 49testfailureequal "WARNING: The following packages cannot be authenticated!
c4ffa042
MV
50 foo
51E: There are problems and -y was used without --force-yes" aptget install -qq -y foo