test-bug-602412-dequote-redirect 986 B

123456789101112131415161718192021222324252627282930
  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. msgtest 'Test redirection works in' 'apt-get update'
  14. testsuccess --nomsg aptget update
  15. # check that I-M-S header is kept in redirections
  16. testequal 'Hit http://localhost:8080 unstable InRelease
  17. Hit http://localhost:8080 unstable/main Sources
  18. Hit http://localhost:8080 unstable/main amd64 Packages
  19. Hit http://localhost:8080 unstable/main Translation-en
  20. Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1
  21. msgtest 'Test redirection works in' 'package download'
  22. testsuccess --nomsg aptget install unrelated --download-only -y