+ # … but oh noes, hashsum mismatch!
+ SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ mv aptarchive/dists/unstable/main/binary-amd64/Packages.gz aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig
+ 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 "Ign:1 $1 unstable InRelease
+ 404 Not Found
+Hit:2 $1 unstable Release
+Get:4 $1 unstable/main amd64 Packages [$SIZE B]
+Err:4 $1 unstable/main amd64 Packages
+ Hash Sum mismatch
+ Hashes of expected file:
+ - Filesize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig') [weak]
+ - SHA256:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
+ Hashes of received file:
+ - SHA256:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
+ - Filesize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') [weak]
+ Last modification reported: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Release file created at: $(releasefiledate 'aptarchive/dists/unstable/Release')
+Reading package lists...
+E: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch
+ Hashes of expected file:
+ - Filesize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig') [weak]
+ - SHA256:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
+ Hashes of received file:
+ - SHA256:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
+ - Filesize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') [weak]
+ Last modification reported: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Release file created at: $(releasefiledate 'aptarchive/dists/unstable/Release')
+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
+ find aptarchive/dists -name 'InRelease' -delete
+
+ # … now everything is fine again
+ testsuccessequal "Ign:1 $1 unstable InRelease