test-apt-get-download 727 B

1234567891011121314151617181920212223242526272829
  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. setupaptarchive
  10. testdownload() {
  11. local APT="$2"
  12. if [ -n "$3" ]; then
  13. APT="${APT}/${3}"
  14. fi
  15. msgtest "Test download of package file $1 with" "$APT"
  16. aptget -qq download ${APT} && test -f $1 && msgpass || msgfail
  17. }
  18. testdownload apt_1.0_all.deb apt stable
  19. testdownload apt_2.0_all.deb apt
  20. DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
  21. testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) sha256:$(sha256sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris