]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-ims
check for failure message in testsuccess/failure
[apt.git] / test / integration / test-apt-update-ims
CommitLineData
63d0f853
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64'
8
9buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
10
846bc058 11setupaptarchive --no-update
63d0f853
MV
12changetowebserver
13
47450dea
MV
14runtest() {
15 rm -f rootdir/var/lib/apt/lists/localhost*
63d0f853 16
47450dea
MV
17 testsuccess aptget update
18
19 # ensure no leftovers in partial
20 testfailure ls "rootdir/var/lib/apt/lists/partial/*"
21
22 # check that I-M-S header is kept in redirections
1ce24318 23 testequal "$EXPECT" aptget update -o Debug::pkgAcquire::Worker=0 -o Debug::Acquire::http=0
47450dea
MV
24
25 # ensure that we still do a hash check on ims hit
846bc058 26 msgtest 'Test I-M-S' 'reverify'
47450dea
MV
27 aptget update -o Debug::pkgAcquire::Auth=1 2>&1 | grep -A1 'RecivedHash:' | grep -q -- '- SHA' && msgpass || msgfail
28
29 # ensure no leftovers in partial
30 testfailure ls "rootdir/var/lib/apt/lists/partial/*"
31}
32
f3097647 33msgmsg "InRelease"
1ce24318
MV
34EXPECT="Hit http://localhost:8080 unstable InRelease
35Hit http://localhost:8080 unstable/main Sources
36Hit http://localhost:8080 unstable/main amd64 Packages
37Hit http://localhost:8080 unstable/main Translation-en
38Reading package lists..."
39# with InRelease
40runtest
41
42# with gzip
43echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
44runtest
45
f3097647 46msgmsg "Release/Release.gpg"
4dbfe436 47# with Release/Release.gpg
1ce24318 48EXPECT="Ign http://localhost:8080 unstable InRelease
4dbfe436 49 404 Not Found
1ce24318
MV
50Hit http://localhost:8080 unstable Release
51Hit http://localhost:8080 unstable Release.gpg
1ce24318
MV
52Hit http://localhost:8080 unstable/main Sources
53Hit http://localhost:8080 unstable/main amd64 Packages
54Hit http://localhost:8080 unstable/main Translation-en
55Reading package lists..."
56
ab25bf1f 57find aptarchive -name 'InRelease' -delete
1ce24318
MV
58
59echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
47450dea 60runtest
63d0f853 61
47450dea
MV
62echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
63runtest
f3097647
MV
64
65
66# no Release.gpg or InRelease
d4f4bcf7
MV
67configallowinsecurerepositories "true"
68
f3097647
MV
69msgmsg "Release only"
70EXPECT="Ign http://localhost:8080 unstable InRelease
4dbfe436 71 404 Not Found
f3097647
MV
72Hit http://localhost:8080 unstable Release
73Ign http://localhost:8080 unstable Release.gpg
4dbfe436 74 404 Not Found
f3097647
MV
75Hit http://localhost:8080 unstable/main Sources
76Hit http://localhost:8080 unstable/main amd64 Packages
77Hit http://localhost:8080 unstable/main Translation-en
9d653a6d
DK
78Reading package lists...
79W: The data from 'http://localhost:8080 unstable Release.gpg' is not signed. Packages from that repository can not be authenticated."
f3097647 80
ab25bf1f 81find aptarchive -name 'Release.gpg' -delete
f3097647 82
f3097647
MV
83echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
84runtest
85
86echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
87runtest