4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
11 buildsimplenativepackage
'apt' 'all' '1.0' 'stable'
12 buildsimplenativepackage
'apt' 'all' '2.0' 'unstable'
13 insertinstalledpackage
'vrms' 'all' '1.0'
17 setupaptarchive
--no-update
20 # directories should be readable by everyone
21 find aptarchive
/dists
-type d
| while read dir
; do
24 # apt-ftparchive knows how to chmod files
25 find aptarchive
/dists
-name '*Packages*' -type f
| while read file; do
26 testaccessrights
"$file" '644'
29 # created by the framework without special care
30 find aptarchive
/dists
-name '*Release*' -type f
| while read file; do
31 testaccessrights
"$file" '640'
34 testsuccess aptget update
41 msgtest
"Test download of package file $1 with" "$APT"
42 testsuccess
--nomsg aptget download
${APT} -o Debug
::pkgAcquire
::Worker
=1 -o Debug
::pkgAcquire
::Auth
=1
43 testsuccess
test -f "$1"
47 # normal case as "root"
50 testdownload apt_2.0_all.deb apt
53 # simulate normal user with non-existent root-owned directories
54 rm -rf rootdir
/var
/cache
/apt
/archives
/
55 mkdir rootdir
/var
/cache
/apt
/archives
/
56 addtrap
'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
57 chmod -R -w rootdir
/var
/cache
/apt
/archives
63 testdownload apt_1.0_all.deb apt stable
64 testdownload apt_2.0_all.deb apt
66 DEBFILE
="$(readlink -f ../aptarchive)/pool/apt_2.0_all.deb"
67 testequal
"'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s "$DEBFILE") SHA512:$(sha512sum "$DEBFILE" | cut -d' ' -f 1)" aptget download apt
--print-uris
70 testequal
"E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
--print-uris
71 testequal
"E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
74 testsuccess aptget download apt
75 testsuccess aptget download apt
76 testsuccess
test -s apt_2.0_all.deb
78 rm -f apt_1.0_all.deb apt_2.0_all.deb
81 testsuccess aptget download apt apt apt
/unstable apt
=2.0
82 testsuccess
test -s apt_2.0_all.deb
84 # restore "root" rights
86 chmod -f -R +w
"$PWD/rootdir/var/cache/apt/archives"
87 rm -rf rootdir
/var
/cache
/apt
/archives
/
89 # file: debs aren't copied to archives, so change to http which obviously are
91 testsuccess aptget update
93 # test with already stored deb
94 testsuccess aptget
install -d apt
95 testsuccess
test -s rootdir
/var
/cache
/apt
/archives
/apt_2.0_all.deb
96 testaccessrights
'aptarchive/pool/apt_2.0_all.deb' '644'
97 mv aptarchive
/pool
/apt_2.0_all.deb aptarchive
/pool
/apt_2.0_all.deb.gone
99 testdownload apt_2.0_all.deb apt
101 mv aptarchive
/pool
/apt_2.0_all.deb.gone aptarchive
/pool
/apt_2.0_all.deb