test-bug-602412-dequote-redirect 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 -o aptwebserver::redirect::replace::/pool/=/newpool/ \
  10. -o aptwebserver::redirect::replace::/dists/=/newdists/
  11. mv aptarchive/pool aptarchive/newpool
  12. mv aptarchive/dists aptarchive/newdists
  13. testrun() {
  14. msgtest 'Test redirection works in' 'apt-get update'
  15. testsuccess --nomsg aptget update
  16. # check that I-M-S header is kept in redirections
  17. testequal "Hit $1 unstable InRelease
  18. Hit $1 unstable/main Sources
  19. Hit $1 unstable/main amd64 Packages
  20. Hit $1 unstable/main Translation-en
  21. Reading package lists..." aptget update
  22. msgtest 'Test redirection works in' 'package download'
  23. testsuccess --nomsg aptget install unrelated --download-only -y
  24. }
  25. testrun 'http://localhost:8080'
  26. rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
  27. changetohttpswebserver
  28. testrun 'https://localhost:4433'