test-apt-get-download 887 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
  8. buildsimplenativepackage 'apt' 'all' '2.0' 'unstable'
  9. insertinstalledpackage 'vrms' 'all' '1.0'
  10. setupaptarchive
  11. testdownload() {
  12. local APT="$2"
  13. if [ -n "$3" ]; then
  14. APT="${APT}/${3}"
  15. fi
  16. msgtest "Test download of package file $1 with" "$APT"
  17. aptget -qq download ${APT} && test -f $1 && msgpass || msgfail
  18. rm $1
  19. }
  20. testdownload apt_1.0_all.deb apt stable
  21. testdownload apt_2.0_all.deb apt
  22. DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
  23. testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris
  24. # deb:677887
  25. testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms