test-apt-update-ims 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  10. runtest() {
  11. rm -f rootdir/var/lib/apt/lists/localhost*
  12. testsuccess aptget update
  13. # ensure no leftovers in partial
  14. testfailure ls "rootdir/var/lib/apt/lists/partial/*"
  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::Worker=0 -o Debug::Acquire::http=0
  21. # ensure that we still do a hash check on ims hit
  22. msgtest 'Test I-M-S reverify'
  23. aptget update -o Debug::pkgAcquire::Auth=1 2>&1 | grep -A1 'RecivedHash:' | grep -q -- '- SHA' && msgpass || msgfail
  24. # ensure no leftovers in partial
  25. testfailure ls "rootdir/var/lib/apt/lists/partial/*"
  26. }
  27. runtest
  28. echo "Acquire::GzipIndexes "1";" > rootdir/etc/apt/apt.conf.d/02compressindex
  29. runtest