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.
 
 
 
 
 
 

54 lines
1.9 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
  8. setupaptarchive
  9. changetowebserver --request-absolute='uri'
  10. msgtest 'Check that absolute paths are' 'not accepted'
  11. testfailure --nomsg aptget update --allow-insecure-repositories
  12. echo "Acquire::http::Proxy \"http://localhost:${APTHTTPPORT}\";" > rootdir/etc/apt/apt.conf.d/99proxy
  13. msgtest 'Check that requests to proxies are' 'absolute uris via config'
  14. testsuccess --nomsg aptget update
  15. testsuccessequal 'Reading package lists...
  16. Building dependency tree...
  17. The following NEW packages will be installed:
  18. unrelated
  19. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  20. Inst unrelated (0.5~squeeze1 unstable [all])
  21. Conf unrelated (0.5~squeeze1 unstable [all])' aptget install unrelated -s
  22. rm -f rootdir/etc/apt/apt.conf.d/99proxy
  23. echo "Acquire::http::Proxy-Auto-Detect \"${TMPWORKINGDIRECTORY}/apt-proxy-detect\";" > rootdir/etc/apt/apt.conf.d/02proxy-detect
  24. cat > "${TMPWORKINGDIRECTORY}/apt-proxy-detect" <<EOF
  25. #!/bin/sh
  26. set -e
  27. echo "http://localhost:${APTHTTPPORT}"
  28. EOF
  29. chmod 755 "${TMPWORKINGDIRECTORY}/apt-proxy-detect"
  30. msgtest 'Check that requests to proxies are' 'absolute uris via auto-detect'
  31. testsuccess aptget update -o Debug::Acquire::http=1
  32. testsuccessequal 'Reading package lists...
  33. Building dependency tree...
  34. The following NEW packages will be installed:
  35. unrelated
  36. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  37. Inst unrelated (0.5~squeeze1 unstable [all])
  38. Conf unrelated (0.5~squeeze1 unstable [all])' aptget install unrelated -s
  39. chmod 444 "${TMPWORKINGDIRECTORY}/apt-proxy-detect"
  40. msgtest 'Check that non-executable proxy commands result in' 'permission error'
  41. testfailure --nomsg aptget update
  42. testsuccess grep 'can not be executed' rootdir/tmp/testfailure.output