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