From 89ac907ca37d13c1087a1d5a749a9717e14460d4 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 31 Jan 2014 21:14:48 +0400 Subject: [PATCH] Sytem test for aptly publish list/drop. --- system/t06_publish/PublishDrop1Test_gold | 4 ++ system/t06_publish/PublishDrop2Test_gold | 4 ++ system/t06_publish/PublishDrop3Test_gold | 3 + system/t06_publish/PublishDrop4Test_gold | 4 ++ system/t06_publish/PublishList1Test_gold | 1 + system/t06_publish/PublishList2Test_gold | 3 + system/t06_publish/__init__.py | 4 +- system/t06_publish/drop.py | 87 ++++++++++++++++++++++++ system/t06_publish/list.py | 23 +++++++ 9 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 system/t06_publish/PublishDrop1Test_gold create mode 100644 system/t06_publish/PublishDrop2Test_gold create mode 100644 system/t06_publish/PublishDrop3Test_gold create mode 100644 system/t06_publish/PublishDrop4Test_gold create mode 100644 system/t06_publish/PublishList1Test_gold create mode 100644 system/t06_publish/PublishList2Test_gold create mode 100644 system/t06_publish/drop.py create mode 100644 system/t06_publish/list.py diff --git a/system/t06_publish/PublishDrop1Test_gold b/system/t06_publish/PublishDrop1Test_gold new file mode 100644 index 00000000..306bc267 --- /dev/null +++ b/system/t06_publish/PublishDrop1Test_gold @@ -0,0 +1,4 @@ +Removing ${HOME}/.aptly/public/dists... +Removing ${HOME}/.aptly/public/pool... + +Published repositroy has been removed successfully. diff --git a/system/t06_publish/PublishDrop2Test_gold b/system/t06_publish/PublishDrop2Test_gold new file mode 100644 index 00000000..964b5307 --- /dev/null +++ b/system/t06_publish/PublishDrop2Test_gold @@ -0,0 +1,4 @@ +Removing ${HOME}/.aptly/public/ppa/smira/dists... +Removing ${HOME}/.aptly/public/ppa/smira/pool... + +Published repositroy has been removed successfully. diff --git a/system/t06_publish/PublishDrop3Test_gold b/system/t06_publish/PublishDrop3Test_gold new file mode 100644 index 00000000..bc282720 --- /dev/null +++ b/system/t06_publish/PublishDrop3Test_gold @@ -0,0 +1,3 @@ +Removing ${HOME}/.aptly/public/dists/sq1... + +Published repositroy has been removed successfully. diff --git a/system/t06_publish/PublishDrop4Test_gold b/system/t06_publish/PublishDrop4Test_gold new file mode 100644 index 00000000..0be371e0 --- /dev/null +++ b/system/t06_publish/PublishDrop4Test_gold @@ -0,0 +1,4 @@ +Removing ${HOME}/.aptly/public/dists/sq1... +Removing ${HOME}/.aptly/public/pool/contrib... + +Published repositroy has been removed successfully. diff --git a/system/t06_publish/PublishList1Test_gold b/system/t06_publish/PublishList1Test_gold new file mode 100644 index 00000000..aee99790 --- /dev/null +++ b/system/t06_publish/PublishList1Test_gold @@ -0,0 +1 @@ +No snapshots have been published. Publish a snapshot by running `aptly publish snapshot ...`. diff --git a/system/t06_publish/PublishList2Test_gold b/system/t06_publish/PublishList2Test_gold new file mode 100644 index 00000000..41898288 --- /dev/null +++ b/system/t06_publish/PublishList2Test_gold @@ -0,0 +1,3 @@ +Published repositories: + * ./maverick (main) [amd64, i386] publishes [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick + * ppa/smira/wheezy (contrib) [amd64] publishes [snap2]: Merged from sources: 'snap1' diff --git a/system/t06_publish/__init__.py b/system/t06_publish/__init__.py index 5bdd44ab..dac2ac9c 100644 --- a/system/t06_publish/__init__.py +++ b/system/t06_publish/__init__.py @@ -3,5 +3,5 @@ Testing publishing snapshots """ from .snapshot import * -#from .list import * -#from .drop import * +from .list import * +from .drop import * diff --git a/system/t06_publish/drop.py b/system/t06_publish/drop.py new file mode 100644 index 00000000..c9066cc3 --- /dev/null +++ b/system/t06_publish/drop.py @@ -0,0 +1,87 @@ +from lib import BaseTest + + +class PublishDrop1Test(BaseTest): + """ + publish drop: existing snapshot + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot snap1", + ] + runCmd = "aptly publish drop maverick" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop1Test, self).check() + + self.check_not_exists('public/dists/') + self.check_not_exists('public/pool/') + + +class PublishDrop2Test(BaseTest): + """ + publish drop: under prefix + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot snap1 ppa/smira", + ] + runCmd = "aptly publish drop maverick ppa/smira" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop2Test, self).check() + + self.check_not_exists('public/ppa/smira/dists/') + self.check_not_exists('public/ppa/smira/pool/') + self.check_exists('public/ppa/smira/') + + +class PublishDrop3Test(BaseTest): + """ + publish drop: drop one distribution + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot -distribution=sq1 snap1", + "aptly publish snapshot -distribution=sq2 snap1", + ] + runCmd = "aptly publish drop sq1" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop3Test, self).check() + + self.check_not_exists('public/dists/sq1') + self.check_exists('public/dists/sq2') + self.check_exists('public/pool/main/') + + +class PublishDrop4Test(BaseTest): + """ + publish drop: drop one of components + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot -distribution=sq1 -component=contrib snap1", + "aptly publish snapshot -distribution=sq2 snap1", + ] + runCmd = "aptly publish drop sq1" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop4Test, self).check() + + self.check_not_exists('public/dists/sq1') + self.check_exists('public/dists/sq2') + self.check_not_exists('public/pool/contrib/') + self.check_exists('public/pool/main/') diff --git a/system/t06_publish/list.py b/system/t06_publish/list.py new file mode 100644 index 00000000..a0fd8694 --- /dev/null +++ b/system/t06_publish/list.py @@ -0,0 +1,23 @@ +from lib import BaseTest + + +class PublishList1Test(BaseTest): + """ + publish list: empty list + """ + runCmd = "aptly publish list" + + +class PublishList2Test(BaseTest): + """ + publish list: several snapshots list + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly snapshot merge snap2 snap1", + "aptly publish snapshot snap1", + "aptly -architectures=amd64 publish snapshot -distribution=wheezy -component=contrib snap2 ppa/smira", + ] + runCmd = "aptly publish list"