test-apt-get-download 880 B

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