]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-ims
close leaking slave fd after setting up pty magic
[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 14runtest() {
4fa34122
DK
15 configallowinsecurerepositories "${1:-false}"
16
47450dea 17 rm -f rootdir/var/lib/apt/lists/localhost*
63d0f853 18
4fa34122
DK
19 if [ "$1" = 'true' ]; then
20 testwarning aptget update
21 else
22 testsuccess aptget update
23 fi
47450dea
MV
24
25 # ensure no leftovers in partial
26 testfailure ls "rootdir/var/lib/apt/lists/partial/*"
27
28 # check that I-M-S header is kept in redirections
1ce24318 29 testequal "$EXPECT" aptget update -o Debug::pkgAcquire::Worker=0 -o Debug::Acquire::http=0
47450dea
MV
30
31 # ensure that we still do a hash check on ims hit
846bc058 32 msgtest 'Test I-M-S' 'reverify'
20801f61 33 aptget update -o Debug::pkgAcquire::Auth=1 2>&1 | grep -A2 'ReceivedHash:' | grep -q -- '- SHA' && msgpass || msgfail
47450dea
MV
34
35 # ensure no leftovers in partial
36 testfailure ls "rootdir/var/lib/apt/lists/partial/*"
37}
38
f3097647 39msgmsg "InRelease"
1ce24318
MV
40EXPECT="Hit http://localhost:8080 unstable InRelease
41Hit http://localhost:8080 unstable/main Sources
42Hit http://localhost:8080 unstable/main amd64 Packages
43Hit http://localhost:8080 unstable/main Translation-en
44Reading package lists..."
45# with InRelease
46runtest
47
48# with gzip
49echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
50runtest
51
f3097647 52msgmsg "Release/Release.gpg"
4dbfe436 53# with Release/Release.gpg
1ce24318 54EXPECT="Ign http://localhost:8080 unstable InRelease
4dbfe436 55 404 Not Found
1ce24318
MV
56Hit http://localhost:8080 unstable Release
57Hit http://localhost:8080 unstable Release.gpg
1ce24318
MV
58Hit http://localhost:8080 unstable/main Sources
59Hit http://localhost:8080 unstable/main amd64 Packages
60Hit http://localhost:8080 unstable/main Translation-en
61Reading package lists..."
62
ab25bf1f 63find aptarchive -name 'InRelease' -delete
1ce24318
MV
64
65echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
47450dea 66runtest
63d0f853 67
47450dea
MV
68echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
69runtest
f3097647 70
f3097647
MV
71# no Release.gpg or InRelease
72msgmsg "Release only"
73EXPECT="Ign http://localhost:8080 unstable InRelease
4dbfe436 74 404 Not Found
f3097647
MV
75Hit http://localhost:8080 unstable Release
76Ign http://localhost:8080 unstable Release.gpg
4dbfe436 77 404 Not Found
f3097647
MV
78Hit http://localhost:8080 unstable/main Sources
79Hit http://localhost:8080 unstable/main amd64 Packages
80Hit http://localhost:8080 unstable/main Translation-en
9d653a6d
DK
81Reading package lists...
82W: The data from 'http://localhost:8080 unstable Release.gpg' is not signed. Packages from that repository can not be authenticated."
f3097647 83
ab25bf1f 84find aptarchive -name 'Release.gpg' -delete
f3097647 85
f3097647 86echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
4fa34122 87runtest "true"
f3097647
MV
88
89echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
4fa34122 90runtest "true"