Add -force-overwrite flag to publish update, switch, snapshot and repo commands. #90

Includes new and updated system tests.
This commit is contained in:
Andrey Smirnov
2014-08-05 17:01:18 +04:00
parent fe879acf9c
commit bb6593d21e
32 changed files with 284 additions and 6 deletions

View File

@@ -782,3 +782,43 @@ class PublishSnapshot32Test(BaseTest):
runCmd = "aptly publish snapshot -component=main,contrib snap32.1"
expectedCode = 2
outputMatchPrepare = lambda _, s: "\n".join([l for l in s.split("\n") if l.startswith("ERROR")])
class PublishSnapshot33Test(BaseTest):
"""
publish snapshot: conflicting files in the snapshot
"""
fixtureCmds = [
"aptly repo create local-repo1",
"aptly repo add local-repo1 ${files}",
"aptly snapshot create snap1 from repo local-repo1",
"aptly repo create local-repo2",
"aptly repo add local-repo2 ${testfiles}",
"aptly snapshot create snap2 from repo local-repo2",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1",
]
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2"
expectedCode = 1
gold_processor = BaseTest.expand_environ
class PublishSnapshot34Test(BaseTest):
"""
publish snapshot: -force-overwrite
"""
fixtureCmds = [
"aptly repo create local-repo1",
"aptly repo add local-repo1 ${files}",
"aptly snapshot create snap1 from repo local-repo1",
"aptly repo create local-repo2",
"aptly repo add local-repo2 ${testfiles}",
"aptly snapshot create snap2 from repo local-repo2",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1",
]
runCmd = "aptly publish snapshot -force-overwrite -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSnapshot34Test, self).check()
self.check_file_contents("public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz", "file")