summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-not-modified
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-03-12 20:29:04 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-25 15:35:52 +0200
commit0340069cc4709a18ba117090763d9f263de999a9 (patch)
tree7a94ceb4e5baebae96bbb06b0248b8500863b191 /test/integration/test-apt-update-not-modified
parent6563390031a88ffd85308ac3c26ea9d10bc6bc99 (diff)
show more details for "Hash Sum mismatch" errors
Users tend to report these errors with just this error message… not very actionable and hard to figure out if this is a temporary or 'permanent' mirror-sync issue or even the occasional apt bug. Showing the involved hashsums and modification times should help in triaging these kind of bugs – and eventually we will have less of them via by-hash. The subheaders aren't marked for translation for now as they are technical glibberish and probably easier to deal with if not translated. After all, our iconic "Hash Sum mismatch" is translated at least. These additions were proposed in #817240 by Peter Palfrader.
Diffstat (limited to 'test/integration/test-apt-update-not-modified')
-rwxr-xr-xtest/integration/test-apt-update-not-modified47
1 files changed, 39 insertions, 8 deletions
diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified
index b1f801bc5..c81a05b2c 100755
--- a/test/integration/test-apt-update-not-modified
+++ b/test/integration/test-apt-update-not-modified
@@ -6,6 +6,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'amd64' 'i386'
+confighashes 'SHA256'
insertpackage 'unstable' 'apt' 'amd64,i386' '1.0'
@@ -34,10 +35,9 @@ Reading package lists..." aptget update
# readd arch so its downloaded again…
configarchitecture 'amd64' 'i386'
# … but oh noes, hashsum mismatch!
- SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
- find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete
- cat >> aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
-
+ 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
@@ -47,8 +47,24 @@ EOF
Get:2 $1 unstable/main amd64 Packages [$SIZE B]
Err:2 $1 unstable/main amd64 Packages
Hash Sum mismatch
+ Hashes of expected file:
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
+ - 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)
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Last modification reported: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Release file created at: $(releasefiledate 'aptarchive/dists/unstable/InRelease')
Reading package lists...
E: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch
+ Hashes of expected file:
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
+ - 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)
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Last modification reported: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ Release file created at: $(releasefiledate 'aptarchive/dists/unstable/InRelease')
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
@@ -93,10 +109,9 @@ Reading package lists..." aptget update
# readd arch so its downloaded again…
configarchitecture 'amd64' 'i386'
# … but oh noes, hashsum mismatch!
- SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
- find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete
- cat >> aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
-
+ 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
@@ -108,8 +123,24 @@ 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:
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
+ - 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)
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ 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:
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
+ - 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)
+ - Checksum-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
+ 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