skip-bug-602412-dequote-redirect 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386'
  7. if ! which lighttpd > /dev/null; then
  8. msgdie 'You need lighttpd for this testcase, sorry…'
  9. exit 1
  10. fi
  11. buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
  12. setupaptarchive
  13. echo "server.modules = ( \"mod_redirect\" )
  14. server.document-root = \"$(readlink -f ./aptarchive)\"
  15. server.port = 8080
  16. server.stat-cache-engine = \"disable\"
  17. url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\" )" > lighttpd.conf
  18. mv aptarchive/pool aptarchive/newpool
  19. lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
  20. lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
  21. addtrap "kill $!;"
  22. local APTARCHIVE="file://$(readlink -f ./aptarchive)"
  23. for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
  24. sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
  25. done
  26. aptget update -qq || msgdie 'apt-get update failed'
  27. aptget install unrelated --download-only -qq || msgdie 'downloading package failed'