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