test-apt-get-download 891 B

1234567891011121314151617181920212223242526272829303132333435
  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. testsuccess --nomsg aptget download ${APT}
  18. testsuccess test -f $1
  19. rm $1
  20. }
  21. testdownload apt_1.0_all.deb apt stable
  22. testdownload apt_2.0_all.deb apt
  23. DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
  24. testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris
  25. # deb:677887
  26. testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms