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.
 
 
 
 
 
 

71 lines
2.4 KiB

  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 -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.' apt update -o quiet::NoProgress=1
  30. cp rootdir/tmp/testsuccess.output aptupdate.output
  31. testfailure grep '^Get.* all Packages ' aptupdate.output
  32. testequal 'foo-2' aptcache pkgnames foo-
  33. configarchitecture 'amd64'
  34. testsuccess apt update
  35. cp rootdir/tmp/testsuccess.output aptupdate.output
  36. testfailure grep '^Get.* all Packages ' aptupdate.output
  37. testequal 'foo-2' aptcache pkgnames foo-
  38. rm -rf rootdir/var/lib/apt/lists
  39. msgmsg 'Releasefile without Architectures field'
  40. getarchitecturesfromreleasefile() { echo -n ''; }
  41. generatereleasefiles
  42. signreleasefiles
  43. testsuccess apt update
  44. cp rootdir/tmp/testsuccess.output aptupdate.output
  45. testsuccess grep '^Get.* all Packages ' aptupdate.output
  46. testequal 'foo-1
  47. foo-2' aptcache pkgnames foo-
  48. # apt doesn't know supported archs, so missing a configured arch is a failure
  49. configarchitecture 'amd64' 'i386'
  50. testfailure apt update
  51. testequal 'foo-1
  52. foo-2' aptcache pkgnames foo-
  53. msgmsg 'No Releasefile'
  54. rm -rf rootdir/var/lib/apt/lists
  55. find aptarchive -name '*Release*' -delete
  56. configarchitecture 'amd64'
  57. testfailure apt update
  58. testwarning apt update --allow-insecure-repositories
  59. testequal 'foo-1
  60. foo-2' aptcache pkgnames foo-