mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Tests for downloading from broken mirror (checksums).
This commit is contained in:
6
system/t04_mirror/UpdateMirror3Test_gold
Normal file
6
system/t04_mirror/UpdateMirror3Test_gold
Normal file
@@ -0,0 +1,6 @@
|
||||
Downloading ${url}dists/hardy/Release...
|
||||
Downloading & parsing package files...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.bz2...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.gz...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages...
|
||||
ERROR: unable to update: ${url}dists/hardy/main/binary-amd64/Packages: sha256 hash mismatch "494414ded24da13c451b13b424928821351c78fce49f93d9e1b55f102790c206" != "8a21688ae769f2b4ffcaa366409f679d"
|
||||
7
system/t04_mirror/UpdateMirror4Test_gold
Normal file
7
system/t04_mirror/UpdateMirror4Test_gold
Normal file
@@ -0,0 +1,7 @@
|
||||
Downloading ${url}dists/hardy/Release...
|
||||
Downloading & parsing package files...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.bz2...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.gz...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages...
|
||||
WARNING: ${url}dists/hardy/main/binary-amd64/Packages: sha256 hash mismatch "494414ded24da13c451b13b424928821351c78fce49f93d9e1b55f102790c206" != "8a21688ae769f2b4ffcaa366409f679d"
|
||||
ERROR: unable to update: malformed stanza syntax
|
||||
12
system/t04_mirror/UpdateMirror5Test_gold
Normal file
12
system/t04_mirror/UpdateMirror5Test_gold
Normal file
@@ -0,0 +1,12 @@
|
||||
Downloading ${url}dists/hardy/Release...
|
||||
Downloading & parsing package files...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.bz2...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.gz...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages...
|
||||
Saving packages to database...
|
||||
Building download queue...
|
||||
Download queue: 1 items, 0.00 GiB size
|
||||
Downloading ${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb...
|
||||
ERROR: unable to update: download errors:
|
||||
${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb: sha1 hash mismatch "8d3a014000038725d6daf8771b42a0784253688f" != "66b27417d37e024c46526c2f6d358a754fc552f3"
|
||||
|
||||
12
system/t04_mirror/UpdateMirror6Test_gold
Normal file
12
system/t04_mirror/UpdateMirror6Test_gold
Normal file
@@ -0,0 +1,12 @@
|
||||
Downloading ${url}dists/hardy/Release...
|
||||
Downloading & parsing package files...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.bz2...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages.gz...
|
||||
Downloading ${url}dists/hardy/main/binary-amd64/Packages...
|
||||
Saving packages to database...
|
||||
Building download queue...
|
||||
Download queue: 1 items, 0.00 GiB size
|
||||
Downloading ${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb...
|
||||
WARNING: ${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb: sha1 hash mismatch "8d3a014000038725d6daf8771b42a0784253688f" != "66b27417d37e024c46526c2f6d358a754fc552f3"
|
||||
|
||||
Mirror `failure` has been successfully updated.
|
||||
15
system/t04_mirror/test_release/dists/hardy/Release
Normal file
15
system/t04_mirror/test_release/dists/hardy/Release
Normal file
@@ -0,0 +1,15 @@
|
||||
Origin: test
|
||||
Label: failure
|
||||
Suite: test
|
||||
Version: 6.0.8
|
||||
Codename: hardy
|
||||
Date: Sat, 19 Oct 2013 13:54:21 UTC
|
||||
Architectures: amd64
|
||||
Components: main
|
||||
Description: Debian 6.0.8 Released 19 October 2013
|
||||
MD5Sum:
|
||||
2e3817293fc275dbee74bd71ce6eb056 4 main/binary-amd64/Packages
|
||||
SHA1:
|
||||
4d13fcc6eda389d4d679602171e11593eadae9b9 4 main/binary-amd64/Packages
|
||||
SHA256:
|
||||
8a21688ae769f2b4ffcaa366409f679d 4 main/binary-amd64/Packages
|
||||
@@ -0,0 +1 @@
|
||||
lala
|
||||
11
system/t04_mirror/test_release2/dists/hardy/Release
Normal file
11
system/t04_mirror/test_release2/dists/hardy/Release
Normal file
@@ -0,0 +1,11 @@
|
||||
Origin: test
|
||||
Label: failure
|
||||
Suite: test
|
||||
Version: 6.0.8
|
||||
Codename: hardy
|
||||
Date: Sat, 19 Oct 2013 13:54:21 UTC
|
||||
Architectures: amd64
|
||||
Components: main
|
||||
Description: Debian 6.0.8 Released 19 October 2013
|
||||
MD5Sum:
|
||||
846549680001f5c632b6ee8e0f183825 827 main/binary-amd64/Packages
|
||||
@@ -0,0 +1,19 @@
|
||||
Package: amanda-client
|
||||
Source: amanda
|
||||
Version: 1:3.3.1-3~bpo60+1
|
||||
Installed-Size: 880
|
||||
Maintainer: Bdale Garbee <bdale@gag.com>
|
||||
Architecture: amd64
|
||||
Replaces: amanda-common (<< 1:2.5.2p1-3)
|
||||
Depends: libc6 (>= 2.3), libcurl3 (>= 7.16.2-1), libglib2.0-0 (>= 2.12.0), libreadline6 (>= 6.0), libssl0.9.8 (>= 0.9.8m-1), amanda-common (= 1:3.3.1-3~bpo60+1)
|
||||
Suggests: gnuplot, dump, smbclient
|
||||
Conflicts: amanda, amanda-common (<< 1:2.5.2p1-3)
|
||||
Description: Advanced Maryland Automatic Network Disk Archiver (Client)
|
||||
Description-md5: 21af3684379a64cacc51c39152ab1062
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Filename: pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb
|
||||
Size: 30
|
||||
MD5sum: 4f7223ebadee9fb57b6796570d60638f
|
||||
SHA1: 66b27417d37e024c46526c2f6d358a754fc552f3
|
||||
SHA256: 3608bca1e44ea6c4d268eb6db02260269892c0b42b86bbf1e77a6fa16c3c9282
|
||||
@@ -0,0 +1 @@
|
||||
012345678901234567890123456789
|
||||
@@ -1,3 +1,4 @@
|
||||
import string
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
@@ -21,3 +22,62 @@ class UpdateMirror2Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror update mirror-xyz"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class UpdateMirror3Test(BaseTest):
|
||||
"""
|
||||
update mirrors: wrong checksum in release file
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release"
|
||||
runCmd = "aptly mirror update failure"
|
||||
expectedCode = 1
|
||||
|
||||
def gold_processor(self, gold):
|
||||
return string.Template(gold).substitute({'url': self.webServerUrl})
|
||||
|
||||
|
||||
class UpdateMirror4Test(BaseTest):
|
||||
"""
|
||||
update mirrors: wrong checksum in release file, but ignore
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release"
|
||||
runCmd = "aptly mirror update -ignore-checksums failure"
|
||||
expectedCode = 1
|
||||
|
||||
def gold_processor(self, gold):
|
||||
return string.Template(gold).substitute({'url': self.webServerUrl})
|
||||
|
||||
|
||||
class UpdateMirror5Test(BaseTest):
|
||||
"""
|
||||
update mirrors: wrong checksum in package
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release2"
|
||||
runCmd = "aptly mirror update failure"
|
||||
expectedCode = 1
|
||||
|
||||
def gold_processor(self, gold):
|
||||
return string.Template(gold).substitute({'url': self.webServerUrl})
|
||||
|
||||
|
||||
class UpdateMirror6Test(BaseTest):
|
||||
"""
|
||||
update mirrors: wrong checksum in package, but ignore
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release2"
|
||||
runCmd = "aptly mirror update -ignore-checksums failure"
|
||||
|
||||
def gold_processor(self, gold):
|
||||
return string.Template(gold).substitute({'url': self.webServerUrl})
|
||||
|
||||
Reference in New Issue
Block a user