]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-download
Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into debian/sid
[apt.git] / test / integration / test-apt-get-download
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
10buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
11buildsimplenativepackage 'apt' 'all' '2.0' 'unstable'
12insertinstalledpackage 'vrms' 'all' '1.0'
13
14setupaptarchive
15
16testdownload() {
17 local APT="$2"
18 if [ -n "$3" ]; then
19 APT="${APT}/${3}"
20 fi
21 msgtest "Test download of package file $1 with" "$APT"
22 testsuccess --nomsg aptget download ${APT}
23 testsuccess test -f $1
24 rm $1
25}
26
27# normal case(es)
28testdownload apt_1.0_all.deb apt stable
29testdownload apt_2.0_all.deb apt
30
31DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
32testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris
33
34# deb:677887
35testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
36
37# deb:736962
38testsuccess aptget download apt
39testsuccess aptget download apt
40testsuccess test -s apt_2.0_all.deb
41
42rm -f apt_1.0_all.deb apt_2.0_all.deb
43
44# deb:738103
45testsuccess aptget download apt apt apt/unstable apt=2.0
46testsuccess test -s apt_2.0_all.deb
47