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.
 
 
 
 
 
 

48 lines
2.0 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. buildsimplenativepackage 'foo' 'amd64' '1'
  8. # the default is 1MB – too much for our simple tests
  9. echo 'APT::Cache-Grow "1000";' > rootdir/etc/apt/apt.conf.d/limit-cachegrow.conf
  10. # experiment with cache remapping
  11. rm -f rootdir/var/cache/apt/*.bin
  12. testsuccess apt install ./incoming/foo_1_amd64.deb -s
  13. msgtest 'Cache files are generated in tests'
  14. if [ ! -e rootdir/var/cache/apt/srcpkgcache.bin -o ! -e rootdir/var/cache/apt/pkgcache.bin ]; then
  15. msgfail 'files do not exist'
  16. ls -l rootdir/var/cache/apt/*.bin
  17. exit 1
  18. else
  19. msgpass
  20. fi
  21. SLSIZE="$(stat -c '%s' rootdir/var/cache/apt/srcpkgcache.bin)"
  22. STSIZE="$(stat -c '%s' rootdir/var/cache/apt/pkgcache.bin)"
  23. rm -f rootdir/var/cache/apt/*.bin
  24. testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE" -o APT::Cache-Grow=0
  25. testfailure test -e rootdir/var/cache/apt/pkgcache.bin
  26. rm -f rootdir/var/cache/apt/*.bin
  27. testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE" -o APT::Cache-Limit="$SLSIZE"
  28. testfailure test -e rootdir/var/cache/apt/pkgcache.bin
  29. rm -f rootdir/var/cache/apt/*.bin
  30. testsuccess apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE"
  31. testsuccess test -e rootdir/var/cache/apt/srcpkgcache.bin -a -e rootdir/var/cache/apt/pkgcache.bin
  32. rm -f rootdir/var/cache/apt/*.bin
  33. testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Grow=0
  34. rm -f rootdir/var/cache/apt/*.bin
  35. testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Limit="$SLSIZE"
  36. rm -f rootdir/var/cache/apt/*.bin
  37. testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Limit="$STSIZE"
  38. rm -f rootdir/var/cache/apt/*.bin
  39. testsuccess apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE"
  40. testsuccess test -e rootdir/var/cache/apt/srcpkgcache.bin -a -e rootdir/var/cache/apt/pkgcache.bin