4 TESTDIR
=$(readlink -f $(dirname $0))
7 configarchitecture
'i386'
10 insertpackage
'testing' 'foo' 'all' '1'
11 insertpackage
'testing' 'foo2' 'all' '1'
12 insertsource
'testing' 'foo' 'all' '1'
13 insertsource
'testing' 'foo2' 'all' '1'
15 setupaptarchive
--no-update
18 find aptarchive \
( -name 'Packages' -o -name 'Sources' -o -name 'Translation-en' \
) -delete
19 for release
in $(find aptarchive -name 'Release'); do
20 cp "$release" "${release}.backup"
23 testsuccess aptget update
24 testsuccess aptcache show foo
25 testsuccess aptget
install foo
-s
27 for get
in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\
+$#\
1#p' aptarchive/webserver.log); do
28 for ext
in '' '.gz'; do
31 FILE
="$(basename -s '.gz' "$get")"
32 msgmsg
'Test filesize mismatch with file' "$FILE"
33 rm -rf rootdir
/var
/lib
/apt
/lists
35 for release
in $(find aptarchive -name 'Release'); do
36 SIZE
="$(awk "/$FILE\$/ { print \$2; exit }" "${release}.backup")"
37 sed "s# $SIZE # $(($SIZE + 111)) #" "${release}.backup" > "$release"
42 if expr match
"$COMPRESSFILE" '^.*Translation-.*$' >/dev
/null
; then
46 $TEST aptget update
-o Debug
::pkgAcquire
::Worker
=1
47 cp rootdir
/tmp
/${TEST}.output rootdir
/tmp
/update.output
48 testsuccess
grep -E "$(basename -s '.gz' "$COMPRESSFILE").*Hash Sum mismatch" rootdir
/tmp
/update.output
49 $TEST aptcache show foo
50 $TEST aptget
install foo
-s
52 testfailure aptcache show bar
53 testfailure aptget
install bar
-s