test-different-methods-for-same-source 1004 B

12345678910111213141516171819202122232425262728293031323334
  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. # install a slowed down file: otherwise its to fast to reproduce combining
  11. NEWMETHODS="$(readlink -f rootdir)/usr/lib/apt/methods"
  12. OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)"
  13. rm "$NEWMETHODS"
  14. mkdir "$NEWMETHODS"
  15. backupIFS="$IFS"
  16. IFS="$(printf "\n\b")"
  17. for METH in $(find "$OLDMETHODS" -maxdepth 1 ! -type d); do
  18. ln -s "$OLDMETHODS/$(basename "$METH")" "$NEWMETHODS"
  19. done
  20. IFS="$backupIFS"
  21. ln -s "${OLDMETHODS}/http" "${NEWMETHODS}/http-ng"
  22. changetowebserver
  23. sed -i -e 's# http:# http-ng:#' $(find rootdir/etc/apt/sources.list.d -name '*-deb-src.list')
  24. testsuccess apt update
  25. cp rootdir/tmp/testsuccess.output update.log
  26. # all requests are folded into the first Release file
  27. testsuccess grep ' http-ng://' update.log
  28. testfailure grep ' http://' update.log