skip-bug-602412-dequote-redirect 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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\",
  18. \"^/dists/(.*)$\" => \"/newdists/\$1\" )" > lighttpd.conf
  19. mv aptarchive/pool aptarchive/newpool
  20. mv aptarchive/dists aptarchive/newdists
  21. lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
  22. lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
  23. addtrap "kill $!;"
  24. APTARCHIVE="file://$(readlink -f ./aptarchive)"
  25. for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
  26. sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
  27. done
  28. aptget update || msgdie 'apt-get update failed'
  29. aptget install unrelated --download-only || msgdie 'downloading package failed'