]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-handle-redirect-as-used-mirror-change
tests: disable generation of Release.gpg by default
[apt.git] / test / integration / test-handle-redirect-as-used-mirror-change
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'amd64'
8configcompression '.' 'gz'
9
10buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
11
12setupaptarchive --no-update
13changetowebserver
14webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/"
15rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme"
16
17testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease [$(stat -c %s aptarchive/dists/unstable/InRelease) B]
18Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
19Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
20Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
21Reading package lists..." aptget update
22
23# ensure we asked the redirector only once
24testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
25
26testsuccessequal "Hit:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease
27Reading package lists..." aptget update
28
29testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
30Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
31
32rm -rf rootdir/var/lib/apt/lists
33testsuccess apt update -o Debug::Acquire::http=1 -o Acquire::SameMirrorForAllIndexes=0
34testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
35Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
36Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
37Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/source/Sources.gz
38Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.gz
39Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.gz" grep '^Location:' aptarchive/webserver.log
40
41cd downloaded
42testsuccess apthelper download-file "http://localhost:${APTHTTPPORT}/redirectme/dists/unstable/InRelease" inrelease
43testsuccess test -s inrelease