System test for wrong checkums. #71

This commit is contained in:
Andrey Smirnov
2015-03-17 00:02:39 +03:00
parent 90d3b623b4
commit c6eeac11a4
2 changed files with 36 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
gpgv: DSA key ID 16DB3E6D
gpgv: Good signature from "Aptly Tester (don't use it) <test@aptly.info>"
[!] unable to process file hardlink_0.2.1_amd64.changes: checksum mismatch MD5: expected 4efce26825af5842f43961096dd890b3 != obtained 7515e9279fc32d0c89db965f4dfdec8c
[!] Some files were skipped due to errors:
/01/hardlink_0.2.1_amd64.changes
ERROR: some files failed to be added
+30
View File
@@ -145,3 +145,33 @@ class IncludeRepo6Test(BaseTest):
super(IncludeRepo6Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)
class IncludeRepo7Test(BaseTest):
"""
include packages to local repo: wrong checksum
"""
fixtureCmds = [
"aptly repo create unstable",
]
runCmd = "aptly repo include -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def prepare(self):
super(IncludeRepo7Test, self).prepare()
self.tempSrcDir = tempfile.mkdtemp()
shutil.copytree(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), os.path.join(self.tempSrcDir, "01"))
with open(os.path.join(self.tempSrcDir, "01", "hardlink_0.2.1.dsc"), "w") as f:
f.write("A" * 949) # file size
self.runCmd += self.tempSrcDir
def check(self):
try:
super(IncludeRepo7Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)