test-http-pipeline-messup 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. buildsimplenativepackage 'pkga' 'all' '1.0' 'stable'
  8. buildsimplenativepackage 'pkgb' 'all' '1.0' 'stable'
  9. buildsimplenativepackage 'pkgc' 'all' '1.0' 'stable'
  10. buildsimplenativepackage 'pkgd' 'all' '1.0' 'stable'
  11. setupaptarchive --no-update
  12. # simulate (and be a predictable) pipeline mess-up by the server/proxy
  13. changetowebserver \
  14. -o 'aptwebserver::overwrite::.*pkga.*::filename=/pool/pkgd_1.0_all.deb' \
  15. -o 'aptwebserver::overwrite::.*pkgc.*::filename=/pool/pkgb_1.0_all.deb' \
  16. -o 'aptwebserver::overwrite::.*pkgb.*::filename=/pool/pkgc_1.0_all.deb' \
  17. -o 'aptwebserver::overwrite::.*pkgd.*::filename=/pool/pkga_1.0_all.deb'
  18. testsuccess aptget update -o Debug::Acquire::http=1 -o Debug::pkgAcquire::Worker=1
  19. # messup is bigger than pipeline: checks if fixup isn't trying to hard
  20. testfailure aptget download pkga pkgb pkgc pkgd "$@" -o Acquire::http::Pipeline-Depth=2
  21. testfailure test -f pkga_1.0_all.deb
  22. # ensure that pipeling is enabled for rest of this test
  23. echo 'Acquire::http::Pipeline-Depth 10;' > rootdir/etc/apt/apt.conf.d/99enable-pipeline
  24. # the output is a bit strange: it looks like it has downloaded pkga 4 times
  25. testsuccess aptget download pkga pkgb pkgc pkgd -o Debug::Acquire::http=1 -o Debug::pkgAcquire::Worker=1
  26. for pkg in 'pkga' 'pkgb' 'pkgc' 'pkgd'; do
  27. testsuccess test -f ${pkg}_1.0_all.deb
  28. testsuccess cmp incoming/${pkg}_1.0_all.deb ${pkg}_1.0_all.deb
  29. rm -f ${pkg}_1.0_all.deb
  30. done
  31. # while hashes will pass (as none are available), sizes will not match, so failure
  32. # checks that no hashes means that pipeline depth is ignored as we can't fixup
  33. testfailure aptget download pkga pkgb pkgc pkgd "$@" --allow-unauthenticated -o Acquire::ForceHash=ROT26