]>
Commit | Line | Data |
---|---|---|
1e0f0f28 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture 'amd64' | |
9 | configcompression '.' 'gz' | |
10 | ||
11 | buildsimplenativepackage 'foo' 'amd64' '1' 'unstable' | |
12 | ||
13 | setupaptarchive --no-update | |
14 | changetowebserver | |
15 | ||
16 | testsuccessequal "Get:1 http://localhost:8080 unstable InRelease [$(stat -c%s aptarchive/dists/unstable/InRelease) B] | |
17 | Get:2 http://localhost:8080 unstable/main Sources [$(stat -c%s aptarchive/dists/unstable/main/source/Sources.gz) B] | |
18 | Get:3 http://localhost:8080 unstable/main amd64 Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B] | |
19 | Get:4 http://localhost:8080 unstable/main Translation-en [$(stat -c%s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B] | |
20 | Reading package lists..." aptget update | |
21 | ||
22 | testempty find rootdir/var/lib/apt/lists -name '*Contents*' | |
23 | ||
24 | cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF | |
25 | APT::Acquire::Targets::deb::Contents { | |
26 | URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE)"; | |
27 | ShortDescription "Contents"; | |
28 | Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents"; | |
29 | }; | |
30 | EOF | |
31 | ||
32 | testsuccessequal "Hit http://localhost:8080 unstable InRelease | |
33 | Get:1 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] | |
34 | Reading package lists..." aptget update | |
35 | ||
36 | testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' find rootdir/var/lib/apt/lists -name '*Contents*' | |
37 | testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' 'aptarchive/dists/unstable/main/Contents-amd64' | |
38 | ||
39 | # no automatic uncompress based on the name please, | |
40 | # only if we downloaded a compressed file, but target was uncompressed | |
41 | cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF | |
42 | APT::Acquire::Targets::deb::Contents { | |
43 | URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE).gz"; | |
44 | ShortDescription "Contents.gz"; | |
45 | Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents.gz"; | |
46 | }; | |
47 | EOF | |
48 | ||
49 | testsuccessequal "Hit http://localhost:8080 unstable InRelease | |
50 | Get:1 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] | |
51 | Reading package lists..." aptget update | |
52 | ||
53 | testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' | |
54 | testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz' |