You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB

  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