You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

77 lines
2.2 KiB

  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. umask 022
  10. setupenvironment
  11. configarchitecture "i386"
  12. insertpackage 'unstable' 'foo' 'i386' '1.0'
  13. insertsource 'unstable' 'foo' 'any' '1.0'
  14. setupaptarchive --no-update
  15. changetowebserver
  16. # FIXME:
  17. # - also check the unauth -> auth success case, i.e. that all files are
  18. # reverified
  19. runtest() {
  20. # start unauthenticated
  21. rm -rf rootdir/var/lib/apt/lists/
  22. find aptarchive/ -name '*Release*' -delete
  23. testwarning aptget update --allow-insecure-repositories
  24. # become authenticated
  25. generatereleasefiles
  26. signreleasefiles
  27. # move uncompressed away
  28. mv aptarchive/dists/unstable/main/binary-i386/Packages \
  29. aptarchive/dists/unstable/main/binary-i386/Packages.uncompressed
  30. # and ensure we re-check the downloaded data
  31. # change the local packages file
  32. PKGS=$(ls rootdir/var/lib/apt/lists/*Packages*)
  33. echo "meep" > $PKGS
  34. listcurrentlistsdirectory > lists.before
  35. # update and ensure all is reverted on the hashsum failure
  36. testfailure aptget update -o Debug::Acquire::Transaction=0 -o Debug::pkgAcquire::Auth=1 -o Debug::pkgAcquire::worker=0 -o Debug::acquire::http=0
  37. # ensure we have before what we have after
  38. msgtest 'Check rollback on going from' 'unauth -> auth'
  39. listcurrentlistsdirectory > lists.after
  40. if cmp lists.before lists.after; then
  41. msgpass
  42. else
  43. echo >&2 '### Output of previous apt-get update ###'
  44. cat >&2 rootdir/tmp/testfailure.output
  45. echo >&2 '### Changes in the lists-directory: ###'
  46. diff -u >&2 lists.before lists.after
  47. msgfail
  48. fi
  49. # move uncompressed back for release file
  50. mv aptarchive/dists/unstable/main/binary-i386/Packages.uncompressed \
  51. aptarchive/dists/unstable/main/binary-i386/Packages
  52. }
  53. for COMPRESSEDINDEXES in 'false' 'true'; do
  54. echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes
  55. if $COMPRESSEDINDEXES; then
  56. msgmsg 'Run tests with GzipIndexes enabled'
  57. else
  58. msgmsg 'Run tests with GzipIndexes disabled'
  59. fi
  60. runtest
  61. done