]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-ims
update test
[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
11setupaptarchive
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
26 msgtest 'Test I-M-S reverify'
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
1ce24318
MV
33EXPECT="Hit http://localhost:8080 unstable InRelease
34Hit http://localhost:8080 unstable/main Sources
35Hit http://localhost:8080 unstable/main amd64 Packages
36Hit http://localhost:8080 unstable/main Translation-en
37Reading package lists..."
38# with InRelease
39runtest
40
41# with gzip
42echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
43runtest
44
45# FIXME: how can we get rid of this extra line
46# "Get:1 http://localhost:8080 unstable Release.gpg"
47#
48# with Release/Release.gpg
49EXPECT="Ign http://localhost:8080 unstable InRelease
50Hit http://localhost:8080 unstable Release
51Hit http://localhost:8080 unstable Release.gpg
52Get:1 http://localhost:8080 unstable Release.gpg
53Hit http://localhost:8080 unstable/main Sources
54Hit http://localhost:8080 unstable/main amd64 Packages
55Hit http://localhost:8080 unstable/main Translation-en
56Reading package lists..."
57
58find aptarchive -name "InRelease" | xargs rm -f
59
60echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
47450dea 61runtest
63d0f853 62
47450dea
MV
63echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
64runtest