Unsigned files shouldn't be accepted. #71

This commit is contained in:
Andrey Smirnov
2015-03-17 00:15:45 +03:00
parent 197e230ef1
commit 2a3bd5546a
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
[!] unable to process file hardlink_0.2.1_amd64.changes: .changes file is not signed and unsigned processing hasn't been enabled
[!] Some files were skipped due to errors:
/01/hardlink_0.2.1_amd64.changes
ERROR: some files failed to be added

View File

@@ -204,6 +204,7 @@ class IncludeRepo8Test(BaseTest):
contents = f.read()
f.seek(0, 0)
f.write(contents.replace('Julian', 'Andrey'))
f.truncate()
self.runCmd += self.tempSrcDir
@@ -212,3 +213,37 @@ class IncludeRepo8Test(BaseTest):
super(IncludeRepo8Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)
class IncludeRepo9Test(BaseTest):
"""
include packages to local repo: unsigned
"""
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(IncludeRepo9Test, 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_amd64.changes"), "r+") as f:
contents = f.readlines()
contents = contents[3:31]
f.seek(0, 0)
f.write("".join(contents))
f.truncate()
self.runCmd += self.tempSrcDir
def check(self):
try:
super(IncludeRepo9Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)