diff --git a/system/t09_repo/IncludeRepo7Test_gold b/system/t09_repo/IncludeRepo7Test_gold new file mode 100644 index 00000000..2215c9dd --- /dev/null +++ b/system/t09_repo/IncludeRepo7Test_gold @@ -0,0 +1,6 @@ +gpgv: DSA key ID 16DB3E6D +gpgv: Good signature from "Aptly Tester (don't use it) " +[!] 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 diff --git a/system/t09_repo/include.py b/system/t09_repo/include.py index ac907504..240900fe 100644 --- a/system/t09_repo/include.py +++ b/system/t09_repo/include.py @@ -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)