]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-update-ims
correct architecture detection for 'rc' packages for purge
[apt.git] / test / integration / test-apt-update-ims
... / ...
CommitLineData
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 --no-update
12changetowebserver
13
14runtest() {
15 configallowinsecurerepositories "${1:-false}"
16
17 rm -f rootdir/var/lib/apt/lists/localhost*
18
19 if [ "$1" = 'true' ]; then
20 testwarning aptget update
21 else
22 testsuccess aptget update
23 fi
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
29 testequal "$EXPECT" aptget update -o Debug::pkgAcquire::Worker=0 -o Debug::Acquire::http=0
30
31 # ensure that we still do a hash check on ims hit
32 msgtest 'Test I-M-S' 'reverify'
33 aptget update -o Debug::pkgAcquire::Auth=1 2>&1 | grep -A2 'ReceivedHash:' | grep -q -- '- SHA' && msgpass || msgfail
34
35 # ensure no leftovers in partial
36 testfailure ls "rootdir/var/lib/apt/lists/partial/*"
37}
38
39msgmsg "InRelease"
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
52msgmsg "Release/Release.gpg"
53# with Release/Release.gpg
54EXPECT="Ign http://localhost:8080 unstable InRelease
55 404 Not Found
56Hit http://localhost:8080 unstable Release
57Hit http://localhost:8080 unstable Release.gpg
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
63find aptarchive -name 'InRelease' -delete
64
65echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
66runtest
67
68echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
69runtest
70
71# no Release.gpg or InRelease
72msgmsg "Release only"
73EXPECT="Ign http://localhost:8080 unstable InRelease
74 404 Not Found
75Hit http://localhost:8080 unstable Release
76Ign http://localhost:8080 unstable Release.gpg
77 404 Not Found
78Hit http://localhost:8080 unstable/main Sources
79Hit http://localhost:8080 unstable/main amd64 Packages
80Hit http://localhost:8080 unstable/main Translation-en
81Reading package lists...
82W: The data from 'http://localhost:8080 unstable Release.gpg' is not signed. Packages from that repository can not be authenticated."
83
84find aptarchive -name 'Release.gpg' -delete
85
86echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex
87runtest "true"
88
89echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
90runtest "true"