]>
Commit | Line | Data |
---|---|---|
dc95fee1 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
dc95fee1 MV |
6 | |
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
0d58c26a | 10 | insertpackage 'stable' 'apt' 'all' '1' |
dc95fee1 MV |
11 | setupaptarchive --no-update |
12 | ||
0d58c26a | 13 | echo 'alright' > aptarchive/working |
4bba5a88 DK |
14 | changetohttpswebserver |
15 | webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://localhost:${APTHTTPPORT}/" | |
16 | webserverconfig 'aptwebserver::redirect::replace::/redirectme2/' "https://localhost:${APTHTTPSPORT}/" | |
dc95fee1 | 17 | |
0d58c26a | 18 | msgtest 'download of a file works via' 'http' |
6c0765c0 | 19 | testsuccess --nomsg downloadfile "http://localhost:${APTHTTPPORT}/working" httpfile |
0d58c26a | 20 | testfileequal httpfile 'alright' |
dc95fee1 | 21 | |
0d58c26a | 22 | msgtest 'download of a file works via' 'https' |
6c0765c0 | 23 | testsuccess --nomsg downloadfile "https://localhost:${APTHTTPSPORT}/working" httpsfile |
0d58c26a | 24 | testfileequal httpsfile 'alright' |
dc95fee1 | 25 | |
0d58c26a | 26 | msgtest 'download of a file does not work if' 'https redirected to http' |
6c0765c0 | 27 | testfailure --nomsg downloadfile "https://localhost:${APTHTTPSPORT}/redirectme/working" redirectfile |
0d58c26a DK |
28 | |
29 | msgtest 'libcurl has forbidden access in last request to' 'http resource' | |
4bba5a88 | 30 | testsuccess --nomsg grep -q -E -- "Redirection from https to 'http://.*' is forbidden" rootdir/tmp/testfailure.output |