]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-acquire-additional-files
configureable acquire targets to download additional files
[apt.git] / test / integration / test-apt-acquire-additional-files
CommitLineData
1e0f0f28
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture 'amd64'
9configcompression '.' 'gz'
10
11buildsimplenativepackage 'foo' 'amd64' '1' 'unstable'
12
13setupaptarchive --no-update
14changetowebserver
15
16testsuccessequal "Get:1 http://localhost:8080 unstable InRelease [$(stat -c%s aptarchive/dists/unstable/InRelease) B]
17Get:2 http://localhost:8080 unstable/main Sources [$(stat -c%s aptarchive/dists/unstable/main/source/Sources.gz) B]
18Get:3 http://localhost:8080 unstable/main amd64 Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B]
19Get:4 http://localhost:8080 unstable/main Translation-en [$(stat -c%s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
20Reading package lists..." aptget update
21
22testempty find rootdir/var/lib/apt/lists -name '*Contents*'
23
24cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
25APT::Acquire::Targets::deb::Contents {
26 URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
27 ShortDescription "Contents";
28 Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
29};
30EOF
31
32testsuccessequal "Hit http://localhost:8080 unstable InRelease
33Get:1 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
34Reading package lists..." aptget update
35
36testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' find rootdir/var/lib/apt/lists -name '*Contents*'
37testsuccess 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
41cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
42APT::Acquire::Targets::deb::Contents {
43 URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE).gz";
44 ShortDescription "Contents.gz";
45 Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents.gz";
46};
47EOF
48
49testsuccessequal "Hit http://localhost:8080 unstable InRelease
50Get:1 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
51Reading package lists..." aptget update
52
53testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*'
54testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz'