test-apt-update-unauth 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. #
  3. # Ensure that when going from unauthenticated to authenticated all
  4. # files are checked again
  5. #
  6. set -e
  7. TESTDIR=$(readlink -f $(dirname $0))
  8. . $TESTDIR/framework
  9. setupenvironment
  10. configarchitecture "i386"
  11. insertpackage 'unstable' 'foo' 'all' '1.0'
  12. insertsource 'unstable' 'foo' 'all' '1.0'
  13. setupaptarchive
  14. changetowebserver
  15. runtest() {
  16. # start unauthenticated
  17. find rootdir/var/lib/apt/lists/ -type f | xargs rm -f
  18. rm -f aptarchive/dists/unstable/*Release*
  19. aptget update -qq
  20. # become authenticated
  21. generatereleasefiles
  22. signreleasefiles
  23. # and ensure we do download the data again
  24. msgtest "Check that the data is check when going to authenticated"
  25. if aptget update |grep -q Hit; then
  26. msgfail
  27. else
  28. msgpass
  29. fi
  30. }
  31. for COMPRESSEDINDEXES in 'false' 'true'; do
  32. echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes
  33. if $COMPRESSEDINDEXES; then
  34. msgmsg 'Run tests with GzipIndexes enabled'
  35. else
  36. msgmsg 'Run tests with GzipIndexes disabled'
  37. fi
  38. runtest
  39. done