System tests for -ignore-signatures + -accept-unsigned. #71

This commit is contained in:
Andrey Smirnov
2015-03-17 00:17:43 +03:00
parent 2a3bd5546a
commit 775670181c
3 changed files with 71 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
Loading repository unstable for changes file hardlink_0.2.1_amd64.changes...
[+] hardlink_0.2.1_source added
[+] hardlink_0.2.1_amd64 added
+3
View File
@@ -0,0 +1,3 @@
Loading repository unstable for changes file hardlink_0.2.1_amd64.changes...
[+] hardlink_0.2.1_source added
[+] hardlink_0.2.1_amd64 added
+65
View File
@@ -247,3 +247,68 @@ class IncludeRepo9Test(BaseTest):
super(IncludeRepo9Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)
class IncludeRepo10Test(BaseTest):
"""
include packages to local repo: wrong signature + -ignore-signatures
"""
fixtureCmds = [
"aptly repo create unstable",
]
runCmd = "aptly repo include -ignore-signatures "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo10Test, 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.read()
f.seek(0, 0)
f.write(contents.replace('Julian', 'Andrey'))
f.truncate()
self.runCmd += self.tempSrcDir
def check(self):
try:
super(IncludeRepo10Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)
class IncludeRepo11Test(BaseTest):
"""
include packages to local repo: unsigned + -accept-unsigned
"""
fixtureCmds = [
"aptly repo create unstable",
]
runCmd = "aptly repo include -accept-unsigned "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo11Test, 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(IncludeRepo11Test, self).check()
finally:
shutil.rmtree(self.tempSrcDir)