test-different-methods-for-same-source 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'stable' 'foo' 'all' '1'
  8. insertsource 'stable' 'foo' 'all' '1'
  9. setupaptarchive --no-update
  10. changetowebserver
  11. webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://localhost:${APTHTTPPORT}/"
  12. echo 'Dir::Bin::Methods::http-ng "http";' > rootdir/etc/apt/apt.conf.d/99add-http-ng-method
  13. sed -i -e 's# http:# http-ng:#' $(find rootdir/etc/apt/sources.list.d -name '*-deb-src.list')
  14. testsuccess apt update -o Debug::Acquire::http-ng=1
  15. cp rootdir/tmp/testsuccess.output update.log
  16. # all requests are folded into the first Release file
  17. testsuccess grep ' http-ng://' update.log
  18. testfailure grep ' http://' update.log
  19. # see if method-specific debug was enabled
  20. testsuccess grep '^Answer for: http-ng:' update.log
  21. rm -rf rootdir/var/lib/apt/lists
  22. sed -i -e "s#:${APTHTTPPORT}/#:${APTHTTPPORT}/redirectme#" rootdir/etc/apt/sources.list.d/*
  23. testsuccess apt update -o Debug::Acquire::http-ng=1
  24. cp rootdir/tmp/testsuccess.output update.log
  25. # all requests are folded into the first Release file
  26. testsuccess grep ' http-ng://' update.log
  27. testfailure grep '^[^L].* http://' update.log
  28. # see if method-specific debug was enabled
  29. testsuccess grep '^Answer for: http-ng:' update.log