test-bug-602412-dequote-redirect 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. local LOG='update.log'
  18. # strip away the [ 304 B ] info
  19. aptget update 2>&1 | sed -e 's/\ \[.*//' > $LOG
  20. testequal "Hit $1 unstable InRelease
  21. Hit $1 unstable/main Sources
  22. Hit $1 unstable/main amd64 Packages
  23. Hit $1 unstable/main Translation-en
  24. Reading package lists..." cat $LOG
  25. msgtest 'Test redirection works in' 'package download'
  26. testsuccess --nomsg aptget install unrelated --download-only -y
  27. }
  28. testrun 'http://localhost:8080'
  29. rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
  30. changetohttpswebserver
  31. testrun 'https://localhost:4433'