test-apt-https-no-redirect 1.0 KB

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