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.
 
 
 
 
 
 

59 lines
1.3 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertinstalledpackage 'build-essential' 'amd64' '1'
  8. buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar'
  9. buildsimplenativepackage 'bar' 'all' '1' 'stable'
  10. setupaptarchive
  11. cp rootdir/var/lib/dpkg/status status.backup
  12. testrun() {
  13. cp status.backup rootdir/var/lib/dpkg/status
  14. cleanup
  15. testdpkgnotinstalled 'bar'
  16. testsuccess aptget build-dep foo -y
  17. testdpkginstalled 'bar'
  18. cleanup
  19. testsuccess aptget source foo
  20. testsuccess test -s foo_1.tar.xz -a -s foo_1.dsc
  21. rm foo_1.tar.xz foo_1.dsc
  22. testsuccess test -d foo-1
  23. rm -rf foo-1
  24. cleanup
  25. testsuccess aptget install foo -y
  26. }
  27. msgmsg 'Caches fully up-to-date'
  28. cleanup() {
  29. rm -f rootdir/var/cache/apt/*.bin
  30. testsuccess aptcache gencaches
  31. }
  32. testrun
  33. msgmsg 'pkgcache.bin is missing'
  34. cleanup() {
  35. rm -f rootdir/var/cache/apt/*.bin
  36. testsuccess aptcache gencaches
  37. rm rootdir/var/cache/apt/pkgcache.bin
  38. }
  39. testrun
  40. msgmsg 'Caches are not writeable'
  41. rm rootdir/var/cache/apt/*.bin
  42. addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;'
  43. chmod 555 rootdir/var/cache/apt
  44. testsuccess aptcache gencaches
  45. cleanup() {
  46. testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555'
  47. }
  48. testrun