]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture 'i386' | |
8 | ||
9 | if ! which lighttpd > /dev/null; then | |
10 | msgdie 'You need lighttpd for this testcase, sorry…' | |
11 | exit 1 | |
12 | fi | |
13 | ||
14 | buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' | |
15 | ||
16 | setupaptarchive | |
17 | ||
18 | echo "server.modules = ( \"mod_redirect\" ) | |
19 | server.document-root = \"$(readlink -f ./aptarchive)\" | |
20 | server.port = 8080 | |
21 | server.stat-cache-engine = \"disable\" | |
22 | url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\" )" > lighttpd.conf | |
23 | ||
24 | mv aptarchive/pool aptarchive/newpool | |
25 | lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' | |
26 | lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & | |
27 | addtrap "kill $!;" | |
28 | ||
29 | local APTARCHIVE="file://$(readlink -f ./aptarchive)" | |
30 | for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do | |
31 | sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#" | |
32 | done | |
33 | ||
34 | aptget update -qq || msgdie 'apt-get update failed' | |
35 | aptget install unrelated --download-only -qq || msgdie 'downloading package failed' | |
36 |