4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture "i386
"
10 insertpackage 'stable' 'apt' 'all' '1'
11 setupaptarchive --no-update
13 echo 'alright' > aptarchive/working
14 changetohttpswebserver
15 webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http
://localhost
:${APTHTTPPORT}/"
16 webserverconfig 'aptwebserver::redirect::replace::/redirectme2/' "https
://localhost
:${APTHTTPSPORT}/"
17 echo 'Dir::Bin::Methods::https+http "https
";' > rootdir/etc/apt/apt.conf.d/99add-https-http-method
19 msgtest 'download of a file works via' 'http'
20 testsuccess --nomsg downloadfile "http
://localhost
:${APTHTTPPORT}/working
" httpfile
21 testfileequal httpfile 'alright'
23 msgtest 'download of a file works via' 'https'
24 testsuccess --nomsg downloadfile "https
://localhost
:${APTHTTPSPORT}/working
" httpsfile
25 testfileequal httpsfile 'alright'
26 rm -f httpfile httpsfile
28 msgtest 'download of http file works via' 'https+http'
29 testsuccess --nomsg downloadfile "http
://localhost
:${APTHTTPPORT}/working
" httpfile
30 testfileequal httpfile 'alright'
32 msgtest 'download of https file works via' 'https+http'
33 testsuccess --nomsg downloadfile "https
://localhost
:${APTHTTPSPORT}/working
" httpsfile
34 testfileequal httpsfile 'alright'
35 rm -f httpfile httpsfile
37 msgtest 'download of a file does not work if' 'https redirected to http'
38 testfailure --nomsg downloadfile "https
://localhost
:${APTHTTPSPORT}/redirectme
/working
" redirectfile
40 msgtest 'libcurl has forbidden access in last request to' 'http resource'
41 testsuccess --nomsg grep -q -E -- "Redirection from https to
'http://.*' is forbidden
" rootdir/tmp/testfailure.output
43 msgtest 'download of a file does work if' 'https+http redirected to https'
44 testsuccess --nomsg downloadfile "https
+http
://localhost
:${APTHTTPPORT}/redirectme
2/working
" redirectfile
45 testfileequal redirectfile 'alright'