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.
 
 
 
 
 
 

55 lines
2.2 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'native'
  7. buildsimplenativepackage 'pkg1' 'all' '1.0' 'stable'
  8. buildsimplenativepackage 'pkg2' 'all' '1.0' 'stable'
  9. buildsimplenativepackage 'pkg3' 'all' '1.0' 'stable'
  10. buildsimplenativepackage 'pkg4' 'all' '1.0' 'stable'
  11. # local (file) installs
  12. setupaptarchive
  13. # a file:// "download" is not a real download and hence passes
  14. testsuccess aptget install pkg1 --no-download --download-only -y
  15. testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb
  16. testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb
  17. # ensure that install from local sources does not remove debs
  18. testsuccess aptget install pkg1 -o APT::Keep-Downloaded-Packages=false
  19. testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb
  20. testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb
  21. # now switch to http and downloading debs
  22. changetowebserver
  23. testsuccess aptget update
  24. # see if no-download really doesn't download the package
  25. testfailuremsg 'E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?' aptget install pkg2 --no-download -y
  26. testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb
  27. testfailure test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb
  28. # ensure that the downloaded pkg is kept with "keep=true"
  29. testsuccess aptget install pkg2 -o APT::Keep-Downloaded-Packages=true
  30. testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb
  31. testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb
  32. # ensure that the downloaded pkg is removed when requested
  33. testsuccess aptget install pkg3 -o APT::Keep-Downloaded-Packages=false
  34. testsuccess test -f aptarchive/pool/pkg3_1.0_all.deb
  35. # this was there before, keep it
  36. testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb
  37. # this got installed so we can remove it now
  38. testfailure test -f rootdir/var/cache/apt/archives/pkg3_1.0_all.deb
  39. # ensure that install from the download dir does not delete packages
  40. mv aptarchive/pool/pkg4_1.0_all.deb rootdir/var/cache/apt/archives
  41. testsuccess aptget install $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb -o APT::Keep-Downloaded-Packages=false
  42. testsuccess test -f $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb