From 5b8390c644873d66a0975a6701b5ea161ecba7a1 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 5 Aug 2014 15:58:47 +0400 Subject: [PATCH] Uncomment and fix publish updat tests. --- system/t06_publish/PublishUpdate1Test_gold | 4 +- system/t06_publish/PublishUpdate2Test_gold | 4 +- system/t06_publish/PublishUpdate3Test_gold | 4 +- system/t06_publish/PublishUpdate4Test_gold | 4 +- system/t06_publish/PublishUpdate5Test_gold | 2 +- system/t06_publish/PublishUpdate7Test_gold | 4 +- system/t06_publish/update.py | 416 ++++++++++----------- 7 files changed, 219 insertions(+), 219 deletions(-) diff --git a/system/t06_publish/PublishUpdate1Test_gold b/system/t06_publish/PublishUpdate1Test_gold index 7208cc8b..9179c19d 100644 --- a/system/t06_publish/PublishUpdate1Test_gold +++ b/system/t06_publish/PublishUpdate1Test_gold @@ -1,7 +1,7 @@ Loading packages... Generating metadata files and linking package files... -Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: -Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: +Signing file 'Release' with gpg, please enter your passphrase when prompted: +Clearsigning file 'Release' with gpg, please enter your passphrase when prompted: Cleaning up prefix "." components main... Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. diff --git a/system/t06_publish/PublishUpdate2Test_gold b/system/t06_publish/PublishUpdate2Test_gold index 7208cc8b..9179c19d 100644 --- a/system/t06_publish/PublishUpdate2Test_gold +++ b/system/t06_publish/PublishUpdate2Test_gold @@ -1,7 +1,7 @@ Loading packages... Generating metadata files and linking package files... -Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: -Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: +Signing file 'Release' with gpg, please enter your passphrase when prompted: +Clearsigning file 'Release' with gpg, please enter your passphrase when prompted: Cleaning up prefix "." components main... Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. diff --git a/system/t06_publish/PublishUpdate3Test_gold b/system/t06_publish/PublishUpdate3Test_gold index 7208cc8b..9179c19d 100644 --- a/system/t06_publish/PublishUpdate3Test_gold +++ b/system/t06_publish/PublishUpdate3Test_gold @@ -1,7 +1,7 @@ Loading packages... Generating metadata files and linking package files... -Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: -Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: +Signing file 'Release' with gpg, please enter your passphrase when prompted: +Clearsigning file 'Release' with gpg, please enter your passphrase when prompted: Cleaning up prefix "." components main... Publish for local repo ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. diff --git a/system/t06_publish/PublishUpdate4Test_gold b/system/t06_publish/PublishUpdate4Test_gold index c0722ced..4ebbbebe 100644 --- a/system/t06_publish/PublishUpdate4Test_gold +++ b/system/t06_publish/PublishUpdate4Test_gold @@ -1,7 +1,7 @@ Loading packages... Generating metadata files and linking package files... -Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: -Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: +Signing file 'Release' with gpg, please enter your passphrase when prompted: +Clearsigning file 'Release' with gpg, please enter your passphrase when prompted: Cleaning up prefix "." components main... Publish for local repo ./maverick [source] publishes {main: [local-repo]} has been successfully updated. diff --git a/system/t06_publish/PublishUpdate5Test_gold b/system/t06_publish/PublishUpdate5Test_gold index 00bd6beb..c28babdc 100644 --- a/system/t06_publish/PublishUpdate5Test_gold +++ b/system/t06_publish/PublishUpdate5Test_gold @@ -1 +1 @@ -ERROR: unable to update: published repo with prefix/distribution ppa/maverick not found +ERROR: unable to update: published repo with storage:prefix/distribution ppa/maverick not found diff --git a/system/t06_publish/PublishUpdate7Test_gold b/system/t06_publish/PublishUpdate7Test_gold index be5355ba..9eb5d807 100644 --- a/system/t06_publish/PublishUpdate7Test_gold +++ b/system/t06_publish/PublishUpdate7Test_gold @@ -1,7 +1,7 @@ Loading packages... Generating metadata files and linking package files... -Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: -Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted: +Signing file 'Release' with gpg, please enter your passphrase when prompted: +Clearsigning file 'Release' with gpg, please enter your passphrase when prompted: Cleaning up prefix "." components contrib, main... Publish for local repo ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated. diff --git a/system/t06_publish/update.py b/system/t06_publish/update.py index 2e5e1476..c5b43af3 100644 --- a/system/t06_publish/update.py +++ b/system/t06_publish/update.py @@ -8,258 +8,258 @@ def strip_processor(output): return "\n".join([l for l in output.split("\n") if not l.startswith(' ') and not l.startswith('Date:')]) -# class PublishUpdate1Test(BaseTest): -# """ -# publish update: removed some packages -# """ -# fixtureCmds = [ -# "aptly repo create local-repo", -# "aptly repo add local-repo ${files}/", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", -# "aptly repo remove local-repo pyspi" -# ] -# runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" -# gold_processor = BaseTest.expand_environ +class PublishUpdate1Test(BaseTest): + """ + publish update: removed some packages + """ + fixtureCmds = [ + "aptly repo create local-repo", + "aptly repo add local-repo ${files}/", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", + "aptly repo remove local-repo pyspi" + ] + runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" + gold_processor = BaseTest.expand_environ -# def check(self): -# super(PublishUpdate1Test, self).check() + def check(self): + super(PublishUpdate1Test, self).check() -# self.check_exists('public/dists/maverick/InRelease') -# self.check_exists('public/dists/maverick/Release') -# self.check_exists('public/dists/maverick/Release.gpg') + self.check_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_exists('public/dists/maverick/Release.gpg') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/main/source/Sources') -# self.check_exists('public/dists/maverick/main/source/Sources.gz') -# self.check_exists('public/dists/maverick/main/source/Sources.bz2') + self.check_exists('public/dists/maverick/main/binary-i386/Packages') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/main/source/Sources') + self.check_exists('public/dists/maverick/main/source/Sources.gz') + self.check_exists('public/dists/maverick/main/source/Sources.bz2') -# 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') + 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') -# # verify contents except of sums -# self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor) -# self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + # verify contents except of sums + self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor) + self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# # verify signatures -# self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"), -# "--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/InRelease')]) -# self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"), -# "--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/Release.gpg'), -# os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/Release')]) + # verify signatures + self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"), + "--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/InRelease')]) + self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"), + "--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/Release.gpg'), + os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/Release')]) -# # verify sums -# release = self.read_file('public/dists/maverick/Release').split("\n") -# release = [l for l in release if l.startswith(" ")] -# pathsSeen = set() -# for l in release: -# fileHash, fileSize, path = l.split() -# pathsSeen.add(path) + # verify sums + release = self.read_file('public/dists/maverick/Release').split("\n") + release = [l for l in release if l.startswith(" ")] + pathsSeen = set() + for l in release: + fileHash, fileSize, path = l.split() + pathsSeen.add(path) -# fileSize = int(fileSize) + fileSize = int(fileSize) -# st = os.stat(os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/', path)) -# if fileSize != st.st_size: -# raise Exception("file size doesn't match for %s: %d != %d" % (path, fileSize, st.st_size)) + st = os.stat(os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/', path)) + if fileSize != st.st_size: + raise Exception("file size doesn't match for %s: %d != %d" % (path, fileSize, st.st_size)) -# if len(fileHash) == 32: -# h = hashlib.md5() -# elif len(fileHash) == 40: -# h = hashlib.sha1() -# else: -# h = hashlib.sha256() + if len(fileHash) == 32: + h = hashlib.md5() + elif len(fileHash) == 40: + h = hashlib.sha1() + else: + h = hashlib.sha256() -# h.update(self.read_file(os.path.join('public/dists/maverick', path))) + h.update(self.read_file(os.path.join('public/dists/maverick', path))) -# if h.hexdigest() != fileHash: -# raise Exception("file hash doesn't match for %s: %s != %s" % (path, fileHash, h.hexdigest())) + if h.hexdigest() != fileHash: + raise Exception("file hash doesn't match for %s: %s != %s" % (path, fileHash, h.hexdigest())) -# if pathsSeen != set(['main/binary-i386/Packages', 'main/binary-i386/Packages.bz2', 'main/binary-i386/Packages.gz', -# 'main/source/Sources', 'main/source/Sources.gz', 'main/source/Sources.bz2', -# 'main/binary-i386/Release', 'main/source/Release']): -# raise Exception("path seen wrong: %r" % (pathsSeen, )) + if pathsSeen != set(['main/binary-i386/Packages', 'main/binary-i386/Packages.bz2', 'main/binary-i386/Packages.gz', + 'main/source/Sources', 'main/source/Sources.gz', 'main/source/Sources.bz2', + 'main/binary-i386/Release', 'main/source/Release']): + raise Exception("path seen wrong: %r" % (pathsSeen, )) -# class PublishUpdate2Test(BaseTest): -# """ -# publish update: added some packages -# """ -# fixtureCmds = [ -# "aptly repo create local-repo", -# "aptly repo add local-repo ${files}/libboost-program-options-dev_1.49.0.1_i386.deb ${files}/pyspi_0.6.1-1.3.dsc", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", -# "aptly repo add local-repo ${files}/pyspi-0.6.1-1.3.stripped.dsc" -# ] -# runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" -# gold_processor = BaseTest.expand_environ +class PublishUpdate2Test(BaseTest): + """ + publish update: added some packages + """ + fixtureCmds = [ + "aptly repo create local-repo", + "aptly repo add local-repo ${files}/libboost-program-options-dev_1.49.0.1_i386.deb ${files}/pyspi_0.6.1-1.3.dsc", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", + "aptly repo add local-repo ${files}/pyspi-0.6.1-1.3.stripped.dsc" + ] + runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" + gold_processor = BaseTest.expand_environ -# def check(self): -# super(PublishUpdate2Test, self).check() + def check(self): + super(PublishUpdate2Test, self).check() -# self.check_exists('public/dists/maverick/InRelease') -# self.check_exists('public/dists/maverick/Release') -# self.check_exists('public/dists/maverick/Release.gpg') + self.check_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_exists('public/dists/maverick/Release.gpg') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/main/source/Sources') -# self.check_exists('public/dists/maverick/main/source/Sources.gz') -# self.check_exists('public/dists/maverick/main/source/Sources.bz2') + self.check_exists('public/dists/maverick/main/binary-i386/Packages') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/main/source/Sources') + self.check_exists('public/dists/maverick/main/source/Sources.gz') + self.check_exists('public/dists/maverick/main/source/Sources.bz2') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') -# self.check_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') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') + self.check_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') -# # verify contents except of sums -# self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + # verify contents except of sums + self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# class PublishUpdate3Test(BaseTest): -# """ -# publish update: removed some packages, files occupied by another package -# """ -# fixtureCmds = [ -# "aptly repo create local-repo", -# "aptly repo add local-repo ${files}/", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick2 local-repo", -# "aptly repo remove local-repo pyspi" -# ] -# runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" -# gold_processor = BaseTest.expand_environ +class PublishUpdate3Test(BaseTest): + """ + publish update: removed some packages, files occupied by another package + """ + fixtureCmds = [ + "aptly repo create local-repo", + "aptly repo add local-repo ${files}/", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick2 local-repo", + "aptly repo remove local-repo pyspi" + ] + runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" + gold_processor = BaseTest.expand_environ -# def check(self): -# super(PublishUpdate3Test, self).check() + def check(self): + super(PublishUpdate3Test, self).check() -# self.check_exists('public/dists/maverick/InRelease') -# self.check_exists('public/dists/maverick/Release') -# self.check_exists('public/dists/maverick/Release.gpg') + self.check_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_exists('public/dists/maverick/Release.gpg') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/main/source/Sources') -# self.check_exists('public/dists/maverick/main/source/Sources.gz') -# self.check_exists('public/dists/maverick/main/source/Sources.bz2') + self.check_exists('public/dists/maverick/main/binary-i386/Packages') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/main/source/Sources') + self.check_exists('public/dists/maverick/main/source/Sources.gz') + self.check_exists('public/dists/maverick/main/source/Sources.bz2') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') -# self.check_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') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') + self.check_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 PublishUpdate4Test(BaseTest): -# """ -# publish update: added some packages, but list of published archs doesn't change -# """ -# fixtureCmds = [ -# "aptly repo create local-repo", -# "aptly repo add local-repo ${files}/pyspi_0.6.1-1.3.dsc", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", -# "aptly repo add local-repo ${files}/libboost-program-options-dev_1.49.0.1_i386.deb" -# ] -# runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" -# gold_processor = BaseTest.expand_environ +class PublishUpdate4Test(BaseTest): + """ + publish update: added some packages, but list of published archs doesn't change + """ + fixtureCmds = [ + "aptly repo create local-repo", + "aptly repo add local-repo ${files}/pyspi_0.6.1-1.3.dsc", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo", + "aptly repo add local-repo ${files}/libboost-program-options-dev_1.49.0.1_i386.deb" + ] + runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" + gold_processor = BaseTest.expand_environ -# def check(self): -# super(PublishUpdate4Test, self).check() + def check(self): + super(PublishUpdate4Test, self).check() -# self.check_exists('public/dists/maverick/InRelease') -# self.check_exists('public/dists/maverick/Release') -# self.check_exists('public/dists/maverick/Release.gpg') + self.check_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_exists('public/dists/maverick/Release.gpg') -# self.check_not_exists('public/dists/maverick/main/binary-i386/Packages') -# self.check_not_exists('public/dists/maverick/main/binary-i386/Packages.gz') -# self.check_not_exists('public/dists/maverick/main/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/main/source/Sources') -# self.check_exists('public/dists/maverick/main/source/Sources.gz') -# self.check_exists('public/dists/maverick/main/source/Sources.bz2') + self.check_not_exists('public/dists/maverick/main/binary-i386/Packages') + self.check_not_exists('public/dists/maverick/main/binary-i386/Packages.gz') + self.check_not_exists('public/dists/maverick/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/main/source/Sources') + self.check_exists('public/dists/maverick/main/source/Sources.gz') + self.check_exists('public/dists/maverick/main/source/Sources.bz2') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') -# self.check_not_exists('public/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') + self.check_not_exists('public/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb') -# class PublishUpdate5Test(BaseTest): -# """ -# publish update: no such publish -# """ -# runCmd = "aptly publish update maverick ppa" -# expectedCode = 1 +class PublishUpdate5Test(BaseTest): + """ + publish update: no such publish + """ + runCmd = "aptly publish update maverick ppa" + expectedCode = 1 -# class PublishUpdate6Test(BaseTest): -# """ -# publish update: not a local repo -# """ -# fixtureDB = True -# fixturePool = True -# fixtureCmds = [ -# "aptly snapshot create snap1 from mirror gnuplot-maverick", -# "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1", -# ] -# runCmd = "aptly publish update maverick" -# expectedCode = 1 +class PublishUpdate6Test(BaseTest): + """ + publish update: not a local repo + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1", + ] + runCmd = "aptly publish update maverick" + expectedCode = 1 -# class PublishUpdate7Test(BaseTest): -# """ -# publish update: multiple components, add some packages -# """ -# fixtureCmds = [ -# "aptly repo create repo1", -# "aptly repo create repo2", -# "aptly repo add repo1 ${files}/pyspi_0.6.1-1.3.dsc", -# "aptly repo add repo2 ${files}/libboost-program-options-dev_1.49.0.1_i386.deb", -# "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=main,contrib repo1 repo2", -# "aptly repo add repo1 ${files}/pyspi-0.6.1-1.3.stripped.dsc", -# ] -# runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" -# gold_processor = BaseTest.expand_environ +class PublishUpdate7Test(BaseTest): + """ + publish update: multiple components, add some packages + """ + fixtureCmds = [ + "aptly repo create repo1", + "aptly repo create repo2", + "aptly repo add repo1 ${files}/pyspi_0.6.1-1.3.dsc", + "aptly repo add repo2 ${files}/libboost-program-options-dev_1.49.0.1_i386.deb", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=main,contrib repo1 repo2", + "aptly repo add repo1 ${files}/pyspi-0.6.1-1.3.stripped.dsc", + ] + runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick" + gold_processor = BaseTest.expand_environ -# def check(self): -# super(PublishUpdate7Test, self).check() + def check(self): + super(PublishUpdate7Test, self).check() -# self.check_exists('public/dists/maverick/InRelease') -# self.check_exists('public/dists/maverick/Release') -# self.check_exists('public/dists/maverick/Release.gpg') + self.check_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_exists('public/dists/maverick/Release.gpg') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') -# self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/main/source/Sources') -# self.check_exists('public/dists/maverick/main/source/Sources.gz') -# self.check_exists('public/dists/maverick/main/source/Sources.bz2') + self.check_exists('public/dists/maverick/main/binary-i386/Packages') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/main/source/Sources') + self.check_exists('public/dists/maverick/main/source/Sources.gz') + self.check_exists('public/dists/maverick/main/source/Sources.bz2') -# self.check_exists('public/dists/maverick/contrib/binary-i386/Packages') -# self.check_exists('public/dists/maverick/contrib/binary-i386/Packages.gz') -# self.check_exists('public/dists/maverick/contrib/binary-i386/Packages.bz2') -# self.check_exists('public/dists/maverick/contrib/source/Sources') -# self.check_exists('public/dists/maverick/contrib/source/Sources.gz') -# self.check_exists('public/dists/maverick/contrib/source/Sources.bz2') + self.check_exists('public/dists/maverick/contrib/binary-i386/Packages') + self.check_exists('public/dists/maverick/contrib/binary-i386/Packages.gz') + self.check_exists('public/dists/maverick/contrib/binary-i386/Packages.bz2') + self.check_exists('public/dists/maverick/contrib/source/Sources') + self.check_exists('public/dists/maverick/contrib/source/Sources.gz') + self.check_exists('public/dists/maverick/contrib/source/Sources.bz2') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') -# self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') -# self.check_exists('public/pool/main/p/pyspi/pyspi-0.6.1-1.3.stripped.dsc') -# self.check_exists('public/pool/contrib/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.dsc') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1-1.3.diff.gz') + self.check_exists('public/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz') + self.check_exists('public/pool/main/p/pyspi/pyspi-0.6.1-1.3.stripped.dsc') + self.check_exists('public/pool/contrib/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb') -# # verify contents except of sums -# self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# self.check_file_contents('public/dists/maverick/contrib/source/Sources', 'sources2', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) -# self.check_file_contents('public/dists/maverick/contrib/binary-i386/Packages', 'binary2', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + # verify contents except of sums + self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + self.check_file_contents('public/dists/maverick/contrib/source/Sources', 'sources2', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) + self.check_file_contents('public/dists/maverick/contrib/binary-i386/Packages', 'binary2', match_prepare=lambda s: "\n".join(sorted(s.split("\n")))) class PublishUpdate8Test(BaseTest):