test-apt-get-download 706 B

123456789101112131415161718192021222324252627282930
  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. msgtest 'Test download of package file' $1
  12. if [ -z "$3" ]; then
  13. aptget download ${2}
  14. else
  15. aptget download ${2}/${3}
  16. fi
  17. 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) sha256:$(sha256sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris