From 3342ce490a8ec557f6ca5410a1c77a866f6571b3 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 22 Apr 2014 17:51:29 +0400 Subject: [PATCH] System tests for cleaning up prefix/component. #8 --- system/t06_publish/PublishDrop1Test_gold | 2 +- system/t06_publish/PublishDrop2Test_gold | 2 +- system/t06_publish/PublishDrop3Test_gold | 2 +- system/t06_publish/PublishDrop4Test_gold | 2 +- system/t06_publish/PublishDrop5Test_gold | 4 +++ system/t06_publish/PublishDrop6Test_gold | 1 + system/t06_publish/drop.py | 37 ++++++++++++++++++++++++ 7 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 system/t06_publish/PublishDrop5Test_gold create mode 100644 system/t06_publish/PublishDrop6Test_gold diff --git a/system/t06_publish/PublishDrop1Test_gold b/system/t06_publish/PublishDrop1Test_gold index 306bc267..b1deb597 100644 --- a/system/t06_publish/PublishDrop1Test_gold +++ b/system/t06_publish/PublishDrop1Test_gold @@ -1,4 +1,4 @@ Removing ${HOME}/.aptly/public/dists... Removing ${HOME}/.aptly/public/pool... -Published repositroy has been removed successfully. +Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop2Test_gold b/system/t06_publish/PublishDrop2Test_gold index 964b5307..c3758e10 100644 --- a/system/t06_publish/PublishDrop2Test_gold +++ b/system/t06_publish/PublishDrop2Test_gold @@ -1,4 +1,4 @@ Removing ${HOME}/.aptly/public/ppa/smira/dists... Removing ${HOME}/.aptly/public/ppa/smira/pool... -Published repositroy has been removed successfully. +Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop3Test_gold b/system/t06_publish/PublishDrop3Test_gold index bdb54421..6479ce64 100644 --- a/system/t06_publish/PublishDrop3Test_gold +++ b/system/t06_publish/PublishDrop3Test_gold @@ -1,4 +1,4 @@ Removing ${HOME}/.aptly/public/dists/sq1... Cleaning up prefix "." component "main"... -Published repositroy has been removed successfully. +Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop4Test_gold b/system/t06_publish/PublishDrop4Test_gold index 0be371e0..66bca004 100644 --- a/system/t06_publish/PublishDrop4Test_gold +++ b/system/t06_publish/PublishDrop4Test_gold @@ -1,4 +1,4 @@ Removing ${HOME}/.aptly/public/dists/sq1... Removing ${HOME}/.aptly/public/pool/contrib... -Published repositroy has been removed successfully. +Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop5Test_gold b/system/t06_publish/PublishDrop5Test_gold new file mode 100644 index 00000000..d43ac80d --- /dev/null +++ b/system/t06_publish/PublishDrop5Test_gold @@ -0,0 +1,4 @@ +Removing ${HOME}/.aptly/public/dists/sq2... +Cleaning up prefix "." component "main"... + +Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop6Test_gold b/system/t06_publish/PublishDrop6Test_gold new file mode 100644 index 00000000..e4ec5e71 --- /dev/null +++ b/system/t06_publish/PublishDrop6Test_gold @@ -0,0 +1 @@ +ERROR: unable to remove: published repo with prefix/distribution ./sq1 not found diff --git a/system/t06_publish/drop.py b/system/t06_publish/drop.py index 2fc20d98..31e656c4 100644 --- a/system/t06_publish/drop.py +++ b/system/t06_publish/drop.py @@ -85,3 +85,40 @@ class PublishDrop4Test(BaseTest): self.check_exists('public/dists/sq2') self.check_not_exists('public/pool/contrib/') self.check_exists('public/pool/main/') + + +class PublishDrop5Test(BaseTest): + """ + publish drop: component cleanup + """ + fixtureCmds = [ + "aptly repo create local1", + "aptly repo create local2", + "aptly repo add local1 ${files}/libboost-program-options-dev_1.49.0.1_i386.deb", + "aptly repo add local2 ${files}", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=sq1 local1", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=sq2 local2", + ] + runCmd = "aptly publish drop sq2" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop5Test, self).check() + + self.check_exists('public/dists/sq1') + self.check_not_exists('public/dists/sq2') + self.check_exists('public/pool/main/') + + self.check_not_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') + self.check_not_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') + self.check_not_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') + self.check_not_exists('public/pool/main/p/pyspi/pyspi-0.6.1-1.3.stripped.dsc') + self.check_exists('public/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb') + + +class PublishDrop6Test(BaseTest): + """ + publish drop: no publish + """ + runCmd = "aptly publish drop sq1" + expectedCode = 1