]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-handle-redirect-as-used-mirror-change
eipp: make no difference between remove & purge
[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
12export APT_DONT_SIGN=''
13setupaptarchive --no-update
14changetowebserver
15webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/"
16rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme"
17
18testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease [$(stat -c %s aptarchive/dists/unstable/InRelease) B]
19Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
20Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
21Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
22Reading package lists..." aptget update
23
24# ensure we asked the redirector only once
25testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
26
27testsuccessequal "Hit:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease
28Reading package lists..." aptget update
29
30testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
31Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
32
33rm -rf rootdir/var/lib/apt/lists
34testsuccess apt update -o Debug::Acquire::http=1 -o Acquire::SameMirrorForAllIndexes=0
35testsuccessequal "Location: 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/InRelease
38Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/source/Sources.gz
39Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.gz
40Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.gz" grep '^Location:' aptarchive/webserver.log
41
42cd downloaded
43testsuccess apthelper download-file "http://localhost:${APTHTTPPORT}/redirectme/dists/unstable/InRelease" inrelease
44testsuccess test -s inrelease
45cd - >/dev/null
46
47find aptarchive -name 'InRelease' -delete
48rm -rf rootdir/var/lib/apt/lists
49
50testsuccessequal "Ign:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease
51 404 Not Found
52Get:2 http://0.0.0.0:${APTHTTPPORT} unstable Release [$(stat -c %s aptarchive/dists/unstable/Release) B]
53Get:3 http://0.0.0.0:${APTHTTPPORT} unstable Release.gpg [$(stat -c %s aptarchive/dists/unstable/Release.gpg) B]
54Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
55Get:5 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
56Get:6 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
57Reading package lists..." aptget update
58
59testsuccessequal "Ign:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease
60 404 Not Found
61Hit:2 http://0.0.0.0:${APTHTTPPORT} unstable Release
62Reading package lists..." aptget update
63
64