test-acquire-binary-all 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. buildsimplenativepackage 'foo-1' 'all' '2' 'unstable'
  8. buildsimplenativepackage 'foo-2' 'amd64' '2' 'unstable'
  9. setupaptarchive --no-update
  10. msgmsg 'Releasefile with Architectures field and all included'
  11. testsuccess apt update
  12. cp rootdir/tmp/testsuccess.output aptupdate.output
  13. testsuccess grep '^Get.* all Packages ' aptupdate.output
  14. testequal 'foo-1
  15. foo-2' aptcache pkgnames foo-
  16. listcurrentlistsdirectory > lists.before
  17. testsuccess grep '_binary-all_Packages' lists.before
  18. configarchitecture 'amd64' 'i386'
  19. testsuccessequal "All packages are up to date.
  20. N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1
  21. testfileequal lists.before "$(listcurrentlistsdirectory)"
  22. testequal 'foo-1
  23. foo-2' aptcache pkgnames foo-
  24. rm -rf rootdir/var/lib/apt/lists
  25. msgmsg 'Releasefile with Architectures field but without all'
  26. getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; }
  27. generatereleasefiles
  28. signreleasefiles
  29. testsuccessequal "All packages are up to date.
  30. N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1
  31. cp rootdir/tmp/testsuccess.output aptupdate.output
  32. testfailure grep '^Get.* all Packages ' aptupdate.output
  33. testequal 'foo-2' aptcache pkgnames foo-
  34. configarchitecture 'amd64'
  35. testsuccess apt update
  36. cp rootdir/tmp/testsuccess.output aptupdate.output
  37. testfailure grep '^Get.* all Packages ' aptupdate.output
  38. testequal 'foo-2' aptcache pkgnames foo-
  39. rm -rf rootdir/var/lib/apt/lists
  40. msgmsg 'Releasefile without Architectures field'
  41. getarchitecturesfromreleasefile() { echo -n ''; }
  42. generatereleasefiles
  43. signreleasefiles
  44. testsuccess apt update
  45. cp rootdir/tmp/testsuccess.output aptupdate.output
  46. testsuccess grep '^Get.* all Packages ' aptupdate.output
  47. testequal 'foo-1
  48. foo-2' aptcache pkgnames foo-
  49. # apt doesn't know supported archs, so missing a configured arch is a failure
  50. configarchitecture 'amd64' 'i386'
  51. testfailure apt update -q=0
  52. testequal 'foo-1
  53. foo-2' aptcache pkgnames foo-
  54. msgmsg 'No Releasefile'
  55. rm -rf rootdir/var/lib/apt/lists
  56. find aptarchive -name '*Release*' -delete
  57. configarchitecture 'amd64'
  58. testfailure apt update
  59. testwarning apt update --allow-insecure-repositories
  60. testequal 'foo-1
  61. foo-2' aptcache pkgnames foo-