| 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 | |
| 18 | msgtest 'Test redirection works in' 'apt-get update' |
| 19 | testsuccess --nomsg aptget update |
| 20 | |
| 21 | # check that I-M-S header is kept in redirections |
| 22 | testequal 'Hit http://localhost:8080 unstable InRelease |
| 23 | Hit http://localhost:8080 unstable/main Sources |
| 24 | Hit http://localhost:8080 unstable/main amd64 Packages |
| 25 | Hit http://localhost:8080 unstable/main Translation-en |
| 26 | Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 |
| 27 | |
| 28 | msgtest 'Test redirection works in' 'package download' |
| 29 | testsuccess --nomsg aptget install unrelated --download-only -y |