]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-update-unauth-warning
support arch:all data e.g. in separate Packages file
[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...
f18f2338
DK
30E: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file.
31N: Updating such a repository securily is impossible and therefore disabled by default.
002b1bc4 32N: See apt-secure(8) manpage for repository creation and user configuration details." aptget update --no-allow-insecure-repositories -q=0
bca84917
MV
33
34# no package foo
25b86db1 35testsuccessequal 'Listing...' apt list foo
546dbfc8
DK
36testequal 'lock
37partial' ls rootdir/var/lib/apt/lists
bca84917 38
ff86d7df 39filesize() {
1dd20368
DK
40 local CREATEDBY="$1"
41 shift
42 stat -c%s "$(aptget indextargets --no-release-info --format '$(URI)' "Created-By: $CREATEDBY" "$@" | cut -d'/' -f 3- ).gz"
ff86d7df 43}
bca84917 44# allow override
9d2a8a73
DK
45#aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1
46#exit
47testwarningequal "Get:1 file:$APTARCHIVE unstable InRelease
48Ign:1 file:$APTARCHIVE unstable InRelease
4dbfe436 49 File not found
9d2a8a73 50Get:2 file:$APTARCHIVE unstable Release
1eb1836f 51Ign:2 file:$APTARCHIVE unstable Release
4dbfe436 52 File not found
9d2a8a73
DK
53Get:3 file:$APTARCHIVE unstable/main Sources
54Ign:3 file:$APTARCHIVE unstable/main Sources
55 File not found
56Get:4 file:$APTARCHIVE unstable/main i386 Packages
57Ign:4 file:$APTARCHIVE unstable/main i386 Packages
58 File not found
1dd20368
DK
59Get:5 file:$APTARCHIVE unstable/main all Packages
60Ign:5 file:$APTARCHIVE unstable/main all Packages
61 File not found
62Get:6 file:$APTARCHIVE unstable/main Translation-en
63Ign:6 file:$APTARCHIVE unstable/main Translation-en
9d2a8a73
DK
64 File not found
65Get:3 file:$APTARCHIVE unstable/main Sources
66Ign:3 file:$APTARCHIVE unstable/main Sources
67 File not found
68Get:4 file:$APTARCHIVE unstable/main i386 Packages
69Ign:4 file:$APTARCHIVE unstable/main i386 Packages
70 File not found
1dd20368
DK
71Get:5 file:$APTARCHIVE unstable/main all Packages
72Ign:5 file:$APTARCHIVE unstable/main all Packages
73 File not found
74Get:6 file:$APTARCHIVE unstable/main Translation-en
75Ign:6 file:$APTARCHIVE unstable/main Translation-en
9d2a8a73
DK
76 File not found
77Get:3 file:$APTARCHIVE unstable/main Sources
78Ign:3 file:$APTARCHIVE unstable/main Sources
79 File not found
80Get:4 file:$APTARCHIVE unstable/main i386 Packages
81Ign:4 file:$APTARCHIVE unstable/main i386 Packages
82 File not found
1dd20368
DK
83Get:5 file:$APTARCHIVE unstable/main all Packages
84Ign:5 file:$APTARCHIVE unstable/main all Packages
85 File not found
86Get:6 file:$APTARCHIVE unstable/main Translation-en
87Ign:6 file:$APTARCHIVE unstable/main Translation-en
9d2a8a73 88 File not found
1eb1836f 89Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B]
1dd20368
DK
90Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages' 'Architecture: i386') B]
91Get:5 file:$APTARCHIVE unstable/main all Packages [$(filesize 'Packages' 'Architecture: all') B]
92Get:6 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
bca84917 93Reading package lists...
f18f2338 94W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file.
002b1bc4
DK
95N: Data from such a repository can not be authenticated and is therefore potentially dangerous to use.
96N: See apt-secure(8) manpage for repository creation and user configuration details." aptget update --allow-insecure-repositories -q=0
c4ffa042 97# ensure we can not install the package
25b86db1 98testfailureequal "WARNING: The following packages cannot be authenticated!
c4ffa042 99 foo
b381a482 100E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y foo