summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-not-modified
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-apt-update-not-modified')
-rwxr-xr-xtest/integration/test-apt-update-not-modified23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified
index b1d55c156..bac33d531 100755
--- a/test/integration/test-apt-update-not-modified
+++ b/test/integration/test-apt-update-not-modified
@@ -14,6 +14,7 @@ setupaptarchive --no-update
methodtest() {
msgmsg 'Test InRelease with' "$1"
rm -rf rootdir/var/lib/apt/lists
+ cp -a aptarchive/dists aptarchive/dists.good
# get our cache populated
testsuccess aptget update
listcurrentlistsdirectory > listsdir.lst
@@ -30,8 +31,27 @@ Reading package lists..." aptget update
Reading package lists..." aptget update
testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
- # readd arch so its downloaded again
+ # readd arch so its downloaded again…
configarchitecture 'amd64' 'i386'
+ # … but oh noes, hashsum mismatch!
+ find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete
+ cat >> aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
+
+Package: thisisbad
+Architecture: amd64
+Version: 1
+EOF
+ compressfile aptarchive/dists/unstable/main/binary-amd64/Packages
+ testfailureequal "Hit $1 unstable InRelease
+Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists.good/unstable/main/binary-amd64/Packages.gz') B]
+W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch
+
+E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update
+ testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
+ rm -rf aptarchive/dists
+ cp -a aptarchive/dists.good aptarchive/dists
+
+ # … now everything is fine again
testsuccessequal "Hit $1 unstable InRelease
Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B]
Reading package lists..." aptget update
@@ -46,7 +66,6 @@ Reading package lists..." aptget update
msgmsg 'Test Release.gpg with' "$1"
rm -rf rootdir/var/lib/apt/lists
- cp -a aptarchive/dists aptarchive/dists.good
find aptarchive/dists -name 'InRelease' -delete
# get our cache populated
testsuccess aptget update