]>
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 | ||
11 | setupaptarchive | |
12 | changetowebserver | |
13 | ||
47450dea MV |
14 | runtest() { |
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 | ||
f3097647 | 33 | msgmsg "InRelease" |
1ce24318 MV |
34 | EXPECT="Hit http://localhost:8080 unstable InRelease |
35 | Hit http://localhost:8080 unstable/main Sources | |
36 | Hit http://localhost:8080 unstable/main amd64 Packages | |
37 | Hit http://localhost:8080 unstable/main Translation-en | |
38 | Reading package lists..." | |
39 | # with InRelease | |
40 | runtest | |
41 | ||
42 | # with gzip | |
43 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
44 | runtest | |
45 | ||
f3097647 | 46 | msgmsg "Release/Release.gpg" |
4dbfe436 | 47 | # with Release/Release.gpg |
1ce24318 | 48 | EXPECT="Ign http://localhost:8080 unstable InRelease |
4dbfe436 | 49 | 404 Not Found |
1ce24318 MV |
50 | Hit http://localhost:8080 unstable Release |
51 | Hit http://localhost:8080 unstable Release.gpg | |
1ce24318 MV |
52 | Hit http://localhost:8080 unstable/main Sources |
53 | Hit http://localhost:8080 unstable/main amd64 Packages | |
54 | Hit http://localhost:8080 unstable/main Translation-en | |
55 | Reading package lists..." | |
56 | ||
57 | find aptarchive -name "InRelease" | xargs rm -f | |
58 | ||
59 | echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
47450dea | 60 | runtest |
63d0f853 | 61 | |
47450dea MV |
62 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex |
63 | runtest | |
f3097647 MV |
64 | |
65 | ||
66 | # no Release.gpg or InRelease | |
67 | msgmsg "Release only" | |
68 | EXPECT="Ign http://localhost:8080 unstable InRelease | |
4dbfe436 | 69 | 404 Not Found |
f3097647 MV |
70 | Hit http://localhost:8080 unstable Release |
71 | Ign http://localhost:8080 unstable Release.gpg | |
4dbfe436 | 72 | 404 Not Found |
f3097647 MV |
73 | Hit http://localhost:8080 unstable/main Sources |
74 | Hit http://localhost:8080 unstable/main amd64 Packages | |
75 | Hit http://localhost:8080 unstable/main Translation-en | |
76 | Reading package lists..." | |
77 | ||
78 | find aptarchive -name "Release.gpg" | xargs rm -f | |
79 | ||
80 | echo 'Acquire::AllowInsecureRepositories "1";' > rootdir/etc/apt/apt.conf.d/insecure.conf | |
81 | echo "Acquire::GzipIndexes "0";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
82 | runtest | |
83 | ||
84 | echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex | |
85 | runtest |