]>
Commit | Line | Data |
---|---|---|
7ea27d2a DK |
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 -o aptwebserver::redirect::replace::/pool/=/newpool/ \ | |
13 | -o aptwebserver::redirect::replace::/dists/=/newdists/ | |
14 | ||
15 | mv aptarchive/pool aptarchive/newpool | |
16 | mv aptarchive/dists aptarchive/newdists | |
17 | ||
f9b4f12d DK |
18 | testrun() { |
19 | msgtest 'Test redirection works in' 'apt-get update' | |
20 | testsuccess --nomsg aptget update | |
21 | ||
22 | # check that I-M-S header is kept in redirections | |
77364252 MV |
23 | local LOG='update.log' |
24 | # strip away the [ 304 B ] info | |
25 | aptget update 2>&1 | sed -e 's/\ \[.*//' > $LOG | |
f9b4f12d DK |
26 | testequal "Hit $1 unstable InRelease |
27 | Hit $1 unstable/main Sources | |
28 | Hit $1 unstable/main amd64 Packages | |
29 | Hit $1 unstable/main Translation-en | |
77364252 | 30 | Reading package lists..." cat $LOG |
f9b4f12d DK |
31 | |
32 | msgtest 'Test redirection works in' 'package download' | |
33 | testsuccess --nomsg aptget install unrelated --download-only -y | |
34 | } | |
35 | ||
36 | testrun 'http://localhost:8080' | |
37 | ||
38 | rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives | |
39 | changetohttpswebserver | |
40 | ||
41 | testrun 'https://localhost:4433' |