4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
10 buildsimplenativepackage
'apt' 'all' '1.0' 'stable'
11 buildsimplenativepackage
'apt' 'all' '2.0' 'unstable'
12 insertinstalledpackage
'vrms' 'all' '1.0'
21 msgtest
"Test download of package file $1 with" "$APT"
22 testsuccess
--nomsg aptget download
${APT}
23 testsuccess
test -f "$1"
27 # normal case as "root"
28 testdownload apt_2.0_all.deb apt
30 # simulate normal user with non-existent root-owned directories
31 rm -rf rootdir
/var
/cache
/apt
/archives
/
32 mkdir rootdir
/var
/cache
/apt
/archives
/
33 addtrap
'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
34 chmod -R -w rootdir
/var
/cache
/apt
/archives
37 testdownload apt_1.0_all.deb apt stable
38 testdownload apt_2.0_all.deb apt
40 DEBFILE
="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
41 testequal
"'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt
--print-uris
44 testequal
"E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
47 testsuccess aptget download apt
48 testsuccess aptget download apt
49 testsuccess
test -s apt_2.0_all.deb
51 rm -f apt_1.0_all.deb apt_2.0_all.deb
54 testsuccess aptget download apt apt apt
/unstable apt
=2.0
55 testsuccess
test -s apt_2.0_all.deb
57 # restore "root" rights
58 chmod -f -R +w
$PWD/rootdir
/var
/cache
/apt
/archives
59 rm -rf rootdir
/var
/cache
/apt
/archives
/
61 # file: debs aren't copied to archives, so change to http which obviously are
63 testsuccess aptget update
65 # test with already stored deb
66 testsuccess aptget
install -d apt
67 testsuccess
test -s rootdir
/var
/cache
/apt
/archives
/apt_2.0_all.deb
68 mv aptarchive
/pool
/apt_2.0_all.deb aptarchive
/pool
/apt_2.0_all.deb.gone
69 testdownload apt_2.0_all.deb apt
70 mv aptarchive
/pool
/apt_2.0_all.deb.gone aptarchive
/pool
/apt_2.0_all.deb