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'
18 # apt-ftparchive knows how to chmod files
19 find aptarchive
/dists
-name '*Packages*' -type f
| while read file; do
20 testaccessrights
"$file" '644'
22 # created by the framework without special care
23 find aptarchive
/dists
-name '*Release*' -type f
| while read file; do
24 testaccessrights
"$file" '640'
26 # all copied files are properly chmodded
27 find rootdir
/var
/lib
/apt
/lists
-type f
| while read file; do
28 testaccessrights
"$file" '644'
36 msgtest
"Test download of package file $1 with" "$APT"
37 testsuccess
--nomsg aptget download
${APT}
38 testsuccess
test -f "$1"
42 # normal case as "root"
43 testdownload apt_2.0_all.deb apt
45 # simulate normal user with non-existent root-owned directories
46 rm -rf rootdir
/var
/cache
/apt
/archives
/
47 mkdir rootdir
/var
/cache
/apt
/archives
/
48 addtrap
'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
49 chmod -R -w rootdir
/var
/cache
/apt
/archives
52 testdownload apt_1.0_all.deb apt stable
53 testdownload apt_2.0_all.deb apt
55 DEBFILE
="$(readlink -f aptarchive)/pool/apt_2.0_all.deb"
56 testequal
"'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt
--print-uris
59 testequal
"E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
62 testsuccess aptget download apt
63 testsuccess aptget download apt
64 testsuccess
test -s apt_2.0_all.deb
66 rm -f apt_1.0_all.deb apt_2.0_all.deb
69 testsuccess aptget download apt apt apt
/unstable apt
=2.0
70 testsuccess
test -s apt_2.0_all.deb
72 # restore "root" rights
73 chmod -f -R +w
$PWD/rootdir
/var
/cache
/apt
/archives
74 rm -rf rootdir
/var
/cache
/apt
/archives
/
76 # file: debs aren't copied to archives, so change to http which obviously are
78 testsuccess aptget update
80 # test with already stored deb
81 testsuccess aptget
install -d apt
82 testsuccess
test -s rootdir
/var
/cache
/apt
/archives
/apt_2.0_all.deb
83 testaccessrights
'aptarchive/pool/apt_2.0_all.deb' '644'
84 mv aptarchive
/pool
/apt_2.0_all.deb aptarchive
/pool
/apt_2.0_all.deb.gone
85 testdownload apt_2.0_all.deb apt
86 mv aptarchive
/pool
/apt_2.0_all.deb.gone aptarchive
/pool
/apt_2.0_all.deb