test-apt-update-empty-files 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. configcompression '.' 'gz'
  8. insertpackage 'unstable' 'apt' 'amd64' '1'
  9. # this automatically gives us an empty Sources file
  10. setupaptarchive --no-update
  11. msgmsg 'Test with file'
  12. rm -rf rootdir/var/lib/apt/lists
  13. testsuccess apt update -o Debug::pkgAcquire::Worker=1
  14. cp rootdir/tmp/testsuccess.output apt.output
  15. testfailure grep '%0a\(Alt\)\?Filename:%20/.*/Sources\(\.gz\)\?%0a' apt.output
  16. testempty find rootdir/var/lib/apt/lists -name '*_Sources'
  17. msgmsg 'Test with http'
  18. changetowebserver
  19. rm -rf rootdir/var/lib/apt/lists
  20. testsuccess apt update -o Debug::pkgAcquire::Worker=1
  21. cp rootdir/tmp/testsuccess.output apt.output
  22. testfailure grep 'http:600.*Sources' apt.output
  23. testempty find rootdir/var/lib/apt/lists -name '*_Sources'
  24. msgmsg 'Test lists-cleanup on newly empty'
  25. rm -rf rootdir/var/lib/apt/lists
  26. insertsource 'unstable' 'apt' 'any' '1'
  27. compressfile aptarchive/dists/unstable/main/source/Sources
  28. generatereleasefiles
  29. signreleasefiles
  30. testsuccess apt update -o Debug::pkgAcquire::Worker=1
  31. cp rootdir/tmp/testsuccess.output apt.output
  32. testsuccess grep 'http:600.*Sources' apt.output
  33. echo -n > aptarchive/dists/unstable/main/source/Sources
  34. compressfile aptarchive/dists/unstable/main/source/Sources
  35. generatereleasefiles 'now + 1hour'
  36. signreleasefiles
  37. testsuccess apt update -o Debug::pkgAcquire::Worker=1 -o APT::Get::List-Cleanup=0 -o Debug::Acquire::Transaction=1
  38. cp rootdir/tmp/testsuccess.output apt.output
  39. testfailure grep 'http:600.*Sources' apt.output
  40. testempty find rootdir/var/lib/apt/lists -name '*_Sources'