]>
Commit | Line | Data |
---|---|---|
63d0f853 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture 'amd64' | |
8 | ||
9 | buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' | |
10 | ||
846bc058 | 11 | setupaptarchive --no-update |
63d0f853 MV |
12 | changetowebserver |
13 | ||
47450dea | 14 | runtest() { |
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 | 39 | msgmsg "InRelease" |
1ce24318 MV |
40 | EXPECT="Hit http://localhost:8080 unstable InRelease |
41 | Hit http://localhost:8080 unstable/main Sources | |
42 | Hit http://localhost:8080 unstable/main amd64 Packages | |
43 | Hit http://localhost:8080 unstable/main Translation-en | |
44 | Reading package lists..." | |
45 | # with InRelease | |
46 | runtest | |
47 | ||
48 | # with gzip | |
49 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
50 | runtest | |
51 | ||
f3097647 | 52 | msgmsg "Release/Release.gpg" |
4dbfe436 | 53 | # with Release/Release.gpg |
1ce24318 | 54 | EXPECT="Ign http://localhost:8080 unstable InRelease |
4dbfe436 | 55 | 404 Not Found |
1ce24318 MV |
56 | Hit http://localhost:8080 unstable Release |
57 | Hit http://localhost:8080 unstable Release.gpg | |
1ce24318 MV |
58 | Hit http://localhost:8080 unstable/main Sources |
59 | Hit http://localhost:8080 unstable/main amd64 Packages | |
60 | Hit http://localhost:8080 unstable/main Translation-en | |
61 | Reading package lists..." | |
62 | ||
ab25bf1f | 63 | find aptarchive -name 'InRelease' -delete |
1ce24318 MV |
64 | |
65 | echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
47450dea | 66 | runtest |
63d0f853 | 67 | |
47450dea MV |
68 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex |
69 | runtest | |
f3097647 | 70 | |
f3097647 MV |
71 | # no Release.gpg or InRelease |
72 | msgmsg "Release only" | |
73 | EXPECT="Ign http://localhost:8080 unstable InRelease | |
4dbfe436 | 74 | 404 Not Found |
f3097647 MV |
75 | Hit http://localhost:8080 unstable Release |
76 | Ign http://localhost:8080 unstable Release.gpg | |
4dbfe436 | 77 | 404 Not Found |
f3097647 MV |
78 | Hit http://localhost:8080 unstable/main Sources |
79 | Hit http://localhost:8080 unstable/main amd64 Packages | |
80 | Hit http://localhost:8080 unstable/main Translation-en | |
9d653a6d DK |
81 | Reading package lists... |
82 | W: The data from 'http://localhost:8080 unstable Release.gpg' is not signed. Packages from that repository can not be authenticated." | |
f3097647 | 83 | |
ab25bf1f | 84 | find aptarchive -name 'Release.gpg' -delete |
f3097647 | 85 | |
f3097647 | 86 | echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex |
4fa34122 | 87 | runtest "true" |
f3097647 MV |
88 | |
89 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
4fa34122 | 90 | runtest "true" |