summaryrefslogtreecommitdiff
path: root/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-06 12:28:00 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-06-09 12:57:35 +0200
commit448c38bdcd72b52f11ec5f326f822cf57653f81c (patch)
tree98f26e9d477e720c3448773f398e6b13e0e431c7 /test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
parent58702f8563a443a7c6e66253b259c2488b877290 (diff)
rework hashsum verification in the acquire system
Having every item having its own code to verify the file(s) it handles is an errorprune process and easy to break, especially if items move through various stages (download, uncompress, patching, …). With a giant rework we centralize (most of) the verification to have a better enforcement rate and (hopefully) less chance for bugs, but it breaks the ABI bigtime in exchange – and as we break it anyway, it is broken even harder. It shouldn't effect most frontends as they don't deal with the acquire system at all or implement their own items, but some do and will need to be patched (might be an opportunity to use apt on-board material). The theory is simple: Items implement methods to decide if hashes need to be checked (in this stage) and to return the expected hashes for this item (in this stage). The verification itself is done in worker message passing which has the benefit that a hashsum error is now a proper error for the acquire system rather than a Done() which is later revised to a Failed().
Diffstat (limited to 'test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum')
-rwxr-xr-xtest/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
index ec74a750b..555d8fcaa 100755
--- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
+++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
@@ -176,7 +176,11 @@ testmismatch() {
Building dependency tree...
Need to get 6 B of source archives.
Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B]
+Err http://localhost:8080/ $1 1.0 (dsc)
+ Hash Sum mismatch
Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B]
+Err http://localhost:8080/ $1 1.0 (tar)
+ Hash Sum mismatch
E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch
E: Failed to fetch http://localhost:8080/${1}_1.0.tar.gz Hash Sum mismatch
@@ -238,6 +242,8 @@ Building dependency tree...
Need to get 6 B of source archives.
Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar) [3 B]
Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) [3 B]
+Err http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc)
+ Hash Sum mismatch
E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch
E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha1-bad
@@ -247,6 +253,8 @@ testfailureequal 'Reading package lists...
Building dependency tree...
Need to get 6 B of source archives.
Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) [3 B]
+Err http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar)
+ Hash Sum mismatch
Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc) [3 B]
E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch