]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-https-no-redirect
report warnings&errors consistently in edit-sources
[apt.git] / test / integration / test-apt-https-no-redirect
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture "i386"
9
10insertpackage 'stable' 'apt' 'all' '1'
11setupaptarchive --no-update
12
13echo 'alright' > aptarchive/working
14changetohttpswebserver -o "aptwebserver::redirect::replace::/redirectme/=http://localhost:${APTHTTPPORT}/"
15
16msgtest 'download of a file works via' 'http'
17testsuccess --nomsg downloadfile "http://localhost:${APTHTTPPORT}/working" httpfile
18testfileequal httpfile 'alright'
19
20msgtest 'download of a file works via' 'https'
21testsuccess --nomsg downloadfile "https://localhost:${APTHTTPSPORT}/working" httpsfile
22testfileequal httpsfile 'alright'
23
24msgtest 'download of a file does not work if' 'https redirected to http'
25testfailure --nomsg downloadfile "https://localhost:${APTHTTPSPORT}/redirectme/working" redirectfile
26
27msgtest 'libcurl has forbidden access in last request to' 'http resource'
28testsuccess --nomsg grep -q -E -- 'Protocol "?http"? not supported or disabled in libcurl' rootdir/tmp/testfailure.output