From 59d72c81120218ff9c8ce98349f379b4909c8b04 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 31 Jan 2014 19:04:44 +0400 Subject: [PATCH] System tests for aptly publish snapshot. --- system/lib.py | 24 +- system/run.py | 2 +- system/t06_publish/PublishSnapshot10Test_gold | 1 + system/t06_publish/PublishSnapshot11Test_gold | 1 + system/t06_publish/PublishSnapshot12Test_gold | 1 + system/t06_publish/PublishSnapshot1Test_gold | 10 + .../t06_publish/PublishSnapshot1Test_release | 10 + system/t06_publish/PublishSnapshot2Test_gold | 10 + .../t06_publish/PublishSnapshot2Test_release | 9 + system/t06_publish/PublishSnapshot3Test_gold | 10 + .../t06_publish/PublishSnapshot3Test_release | 9 + system/t06_publish/PublishSnapshot4Test_gold | 10 + .../t06_publish/PublishSnapshot4Test_release | 9 + system/t06_publish/PublishSnapshot5Test_gold | 10 + system/t06_publish/PublishSnapshot6Test_gold | 1 + system/t06_publish/PublishSnapshot7Test_gold | 1 + system/t06_publish/PublishSnapshot8Test_gold | 1 + system/t06_publish/PublishSnapshot9Test_gold | 1 + system/t06_publish/__init__.py | 7 + system/t06_publish/snapshot.py | 286 ++++++++++++++++++ 20 files changed, 408 insertions(+), 5 deletions(-) create mode 100644 system/t06_publish/PublishSnapshot10Test_gold create mode 100644 system/t06_publish/PublishSnapshot11Test_gold create mode 100644 system/t06_publish/PublishSnapshot12Test_gold create mode 100644 system/t06_publish/PublishSnapshot1Test_gold create mode 100644 system/t06_publish/PublishSnapshot1Test_release create mode 100644 system/t06_publish/PublishSnapshot2Test_gold create mode 100644 system/t06_publish/PublishSnapshot2Test_release create mode 100644 system/t06_publish/PublishSnapshot3Test_gold create mode 100644 system/t06_publish/PublishSnapshot3Test_release create mode 100644 system/t06_publish/PublishSnapshot4Test_gold create mode 100644 system/t06_publish/PublishSnapshot4Test_release create mode 100644 system/t06_publish/PublishSnapshot5Test_gold create mode 100644 system/t06_publish/PublishSnapshot6Test_gold create mode 100644 system/t06_publish/PublishSnapshot7Test_gold create mode 100644 system/t06_publish/PublishSnapshot8Test_gold create mode 100644 system/t06_publish/PublishSnapshot9Test_gold create mode 100644 system/t06_publish/__init__.py create mode 100644 system/t06_publish/snapshot.py diff --git a/system/lib.py b/system/lib.py index ce39b8e9..71f6be3c 100644 --- a/system/lib.py +++ b/system/lib.py @@ -80,7 +80,9 @@ class BaseTest(object): def run_cmd(self, command, expected_code=0): try: - proc = subprocess.Popen(shlex.split(command), stderr=subprocess.STDOUT, stdout=subprocess.PIPE) + if not hasattr(command, "__iter__"): + command = shlex.split(command) + proc = subprocess.Popen(command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) output, _ = proc.communicate() if proc.returncode != expected_code: raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, expected_code, output)) @@ -107,6 +109,23 @@ class BaseTest(object): def check_cmd_output(self, command, gold_name, match_prepare=None, expected_code=0): self.verify_match(self.get_gold(gold_name), self.run_cmd(command, expected_code=expected_code), match_prepare) + def read_file(self, path): + with open(os.path.join(os.environ["HOME"], ".aptly", path), "r") as f: + return f.read() + + def check_file(self, path, gold_name, match_prepare=None): + contents = self.read_file(path) + + self.verify_match(self.get_gold(gold_name), contents, match_prepare=match_prepare) + + def check_exists(self, path): + if not os.path.exists(os.path.join(os.environ["HOME"], ".aptly", path)): + raise Exception("path %s doesn't exist" % (path, )) + + def check_not_exists(self, path): + if os.path.exists(os.path.join(os.environ["HOME"], ".aptly", path)): + raise Exception("path %s exists" % (path, )) + def verify_match(self, a, b, match_prepare=None): if match_prepare is not None: a = match_prepare(a) @@ -117,9 +136,6 @@ class BaseTest(object): raise Exception("content doesn't match:\n" + diff + "\n") - def check_file(self): - self.verify_match(self.get_gold(), open(self.checkedFile, "r").read()) - check = check_output def prepare(self): diff --git a/system/run.py b/system/run.py index 638943d6..4499b051 100755 --- a/system/run.py +++ b/system/run.py @@ -19,7 +19,7 @@ def run(include_long_tests=False): """ Run system test. """ - tests = glob.glob("t*_*") + tests = ["t06_publish"]#glob.glob("t*_*") fails = [] numTests = numFailed = numSkipped = 0 diff --git a/system/t06_publish/PublishSnapshot10Test_gold b/system/t06_publish/PublishSnapshot10Test_gold new file mode 100644 index 00000000..d7774b5a --- /dev/null +++ b/system/t06_publish/PublishSnapshot10Test_gold @@ -0,0 +1 @@ +ERROR: unable to publish: invalid prefix ppa/pool/la diff --git a/system/t06_publish/PublishSnapshot11Test_gold b/system/t06_publish/PublishSnapshot11Test_gold new file mode 100644 index 00000000..ae6c8aed --- /dev/null +++ b/system/t06_publish/PublishSnapshot11Test_gold @@ -0,0 +1 @@ +ERROR: unable to publish: invalid prefix ../la diff --git a/system/t06_publish/PublishSnapshot12Test_gold b/system/t06_publish/PublishSnapshot12Test_gold new file mode 100644 index 00000000..7a9daa12 --- /dev/null +++ b/system/t06_publish/PublishSnapshot12Test_gold @@ -0,0 +1 @@ +ERROR: unable to publish: snapshot with name snap12 not found diff --git a/system/t06_publish/PublishSnapshot1Test_gold b/system/t06_publish/PublishSnapshot1Test_gold new file mode 100644 index 00000000..f0d80dad --- /dev/null +++ b/system/t06_publish/PublishSnapshot1Test_gold @@ -0,0 +1,10 @@ +Signing file '${HOME}/.aptly/public/dists/maverick/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap1 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ maverick main +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot1Test_release b/system/t06_publish/PublishSnapshot1Test_release new file mode 100644 index 00000000..76006ae6 --- /dev/null +++ b/system/t06_publish/PublishSnapshot1Test_release @@ -0,0 +1,10 @@ +Origin: . maverick +Label: . maverick +Codename: maverick +Date: Fri, 31 Jan 2014 14:18:52 UTC +Architectures: amd64 i386 +Components: main +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/PublishSnapshot2Test_gold b/system/t06_publish/PublishSnapshot2Test_gold new file mode 100644 index 00000000..bbcb32f2 --- /dev/null +++ b/system/t06_publish/PublishSnapshot2Test_gold @@ -0,0 +1,10 @@ +Signing file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap2 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ squeeze main +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot2Test_release b/system/t06_publish/PublishSnapshot2Test_release new file mode 100644 index 00000000..4bbc2f0c --- /dev/null +++ b/system/t06_publish/PublishSnapshot2Test_release @@ -0,0 +1,9 @@ +Origin: . squeeze +Label: . squeeze +Codename: squeeze +Architectures: amd64 i386 +Components: main +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/PublishSnapshot3Test_gold b/system/t06_publish/PublishSnapshot3Test_gold new file mode 100644 index 00000000..03355c52 --- /dev/null +++ b/system/t06_publish/PublishSnapshot3Test_gold @@ -0,0 +1,10 @@ +Signing file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap3 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ squeeze contrib +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot3Test_release b/system/t06_publish/PublishSnapshot3Test_release new file mode 100644 index 00000000..2e61a552 --- /dev/null +++ b/system/t06_publish/PublishSnapshot3Test_release @@ -0,0 +1,9 @@ +Origin: . squeeze +Label: . squeeze +Codename: squeeze +Architectures: amd64 i386 +Components: contrib +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/PublishSnapshot4Test_gold b/system/t06_publish/PublishSnapshot4Test_gold new file mode 100644 index 00000000..feb7ed31 --- /dev/null +++ b/system/t06_publish/PublishSnapshot4Test_gold @@ -0,0 +1,10 @@ +Signing file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '${HOME}/.aptly/public/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap4 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ squeeze main +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot4Test_release b/system/t06_publish/PublishSnapshot4Test_release new file mode 100644 index 00000000..4141caef --- /dev/null +++ b/system/t06_publish/PublishSnapshot4Test_release @@ -0,0 +1,9 @@ +Origin: . squeeze +Label: . squeeze +Codename: squeeze +Architectures: i386 +Components: main +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/PublishSnapshot5Test_gold b/system/t06_publish/PublishSnapshot5Test_gold new file mode 100644 index 00000000..3f650169 --- /dev/null +++ b/system/t06_publish/PublishSnapshot5Test_gold @@ -0,0 +1,10 @@ +Signing file '${HOME}/.aptly/public/ppa/smira/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '${HOME}/.aptly/public/ppa/smira/dists/squeeze/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap5 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ppa/smira/ squeeze main +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot6Test_gold b/system/t06_publish/PublishSnapshot6Test_gold new file mode 100644 index 00000000..2fc3870d --- /dev/null +++ b/system/t06_publish/PublishSnapshot6Test_gold @@ -0,0 +1 @@ +ERROR: unable to guess distribution name, please specify explicitly diff --git a/system/t06_publish/PublishSnapshot7Test_gold b/system/t06_publish/PublishSnapshot7Test_gold new file mode 100644 index 00000000..ef0b8bab --- /dev/null +++ b/system/t06_publish/PublishSnapshot7Test_gold @@ -0,0 +1 @@ +ERROR: prefix/distribution already used by another published repo: ./maverick (main) [amd64, i386] publishes [snap7]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick diff --git a/system/t06_publish/PublishSnapshot8Test_gold b/system/t06_publish/PublishSnapshot8Test_gold new file mode 100644 index 00000000..44f95584 --- /dev/null +++ b/system/t06_publish/PublishSnapshot8Test_gold @@ -0,0 +1 @@ +ERROR: prefix/distribution already used by another published repo: ppa/maverick (main) [amd64, i386] publishes [snap8]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick diff --git a/system/t06_publish/PublishSnapshot9Test_gold b/system/t06_publish/PublishSnapshot9Test_gold new file mode 100644 index 00000000..7b46847b --- /dev/null +++ b/system/t06_publish/PublishSnapshot9Test_gold @@ -0,0 +1 @@ +ERROR: unable to publish: invalid prefix ppa/dists/la diff --git a/system/t06_publish/__init__.py b/system/t06_publish/__init__.py new file mode 100644 index 00000000..5bdd44ab --- /dev/null +++ b/system/t06_publish/__init__.py @@ -0,0 +1,7 @@ +""" +Testing publishing snapshots +""" + +from .snapshot import * +#from .list import * +#from .drop import * diff --git a/system/t06_publish/snapshot.py b/system/t06_publish/snapshot.py new file mode 100644 index 00000000..535f2fef --- /dev/null +++ b/system/t06_publish/snapshot.py @@ -0,0 +1,286 @@ +import os +import hashlib +from lib import BaseTest + + +def strip_processor(output): + return "\n".join([l for l in output.split("\n") if not l.startswith(' ') and not l.startswith('Date:')]) + + +class PublishSnapshot1Test(BaseTest): + """ + publish snapshot: defaults + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot snap1" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot1Test, 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/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/binary-amd64/Packages') + self.check_exists('public/dists/maverick/main/binary-amd64/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-amd64/Packages.bz2') + + self.check_exists('public/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + + # verify contents except of sums + self.check_file('public/dists/maverick/Release', 'release', match_prepare=strip_processor) + + # verify signatures + self.run_cmd(["gpg", "--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/InRelease')]) + self.run_cmd(["gpg", "--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) + + 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)) + + 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))) + + if h.hexdigest() != fileHash: + raise Exception("file hash doesn't match for %s: %s != %s" % (path, fileHash, h.hexdigest())) + + if pathsSeen != set(['main/binary-amd64/Packages', 'main/binary-i386/Packages', 'main/binary-i386/Packages.gz', + 'main/binary-amd64/Packages.gz', 'main/binary-amd64/Packages.bz2', 'main/binary-i386/Packages.bz2']): + raise Exception("path seen wrong: %r" % (pathsSeen, )) + + +class PublishSnapshot2Test(BaseTest): + """ + publish snapshot: different distribution + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap2 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot -distribution=squeeze snap2" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot2Test, self).check() + + self.check_exists('public/dists/squeeze/InRelease') + self.check_exists('public/dists/squeeze/Release') + self.check_exists('public/dists/squeeze/Release.gpg') + + self.check_exists('public/dists/squeeze/main/binary-i386/Packages') + self.check_exists('public/dists/squeeze/main/binary-i386/Packages.gz') + self.check_exists('public/dists/squeeze/main/binary-i386/Packages.bz2') + self.check_exists('public/dists/squeeze/main/binary-amd64/Packages') + self.check_exists('public/dists/squeeze/main/binary-amd64/Packages.gz') + self.check_exists('public/dists/squeeze/main/binary-amd64/Packages.bz2') + + self.check_exists('public/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + + # verify contents except of sums + self.check_file('public/dists/squeeze/Release', 'release', match_prepare=strip_processor) + + +class PublishSnapshot3Test(BaseTest): + """ + publish snapshot: different distribution and component + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap3 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot -distribution=squeeze -component=contrib snap3" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot3Test, self).check() + + self.check_exists('public/dists/squeeze/InRelease') + self.check_exists('public/dists/squeeze/Release') + self.check_exists('public/dists/squeeze/Release.gpg') + + self.check_exists('public/dists/squeeze/contrib/binary-i386/Packages') + self.check_exists('public/dists/squeeze/contrib/binary-i386/Packages.gz') + self.check_exists('public/dists/squeeze/contrib/binary-i386/Packages.bz2') + self.check_exists('public/dists/squeeze/contrib/binary-amd64/Packages') + self.check_exists('public/dists/squeeze/contrib/binary-amd64/Packages.gz') + self.check_exists('public/dists/squeeze/contrib/binary-amd64/Packages.bz2') + + self.check_exists('public/pool/contrib/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + + # verify contents except of sums + self.check_file('public/dists/squeeze/Release', 'release', match_prepare=strip_processor) + + +class PublishSnapshot4Test(BaseTest): + """ + publish snapshot: limit architectures + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap4 from mirror gnuplot-maverick", + ] + runCmd = "aptly -architectures=i386 publish snapshot -distribution=squeeze snap4" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot4Test, self).check() + + self.check_exists('public/dists/squeeze/InRelease') + self.check_exists('public/dists/squeeze/Release') + self.check_exists('public/dists/squeeze/Release.gpg') + + self.check_exists('public/dists/squeeze/main/binary-i386/Packages') + self.check_exists('public/dists/squeeze/main/binary-i386/Packages.gz') + self.check_exists('public/dists/squeeze/main/binary-i386/Packages.bz2') + self.check_not_exists('public/dists/squeeze/main/binary-amd64/Packages') + self.check_not_exists('public/dists/squeeze/main/binary-amd64/Packages.gz') + self.check_not_exists('public/dists/squeeze/main/binary-amd64/Packages.bz2') + + self.check_exists('public/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + + # verify contents except of sums + self.check_file('public/dists/squeeze/Release', 'release', match_prepare=strip_processor) + + +class PublishSnapshot5Test(BaseTest): + """ + publish snapshot: under prefix + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap5 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot -distribution=squeeze snap5 ppa/smira" + + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot5Test, self).check() + + self.check_exists('public/ppa/smira/dists/squeeze/InRelease') + self.check_exists('public/ppa/smira/dists/squeeze/Release') + self.check_exists('public/ppa/smira/dists/squeeze/Release.gpg') + + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-i386/Packages') + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-i386/Packages.gz') + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-i386/Packages.bz2') + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-amd64/Packages') + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-amd64/Packages.gz') + self.check_exists('public/ppa/smira/dists/squeeze/main/binary-amd64/Packages.bz2') + + self.check_exists('public/ppa/smira/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + + +class PublishSnapshot6Test(BaseTest): + """ + publish snapshot: specify distribution + """ + fixtureDB = True + fixtureCmds = [ + "aptly snapshot create snap from mirror gnuplot-maverick", + "aptly snapshot merge snap6 snap" + ] + runCmd = "aptly publish snapshot snap6" + expectedCode = 1 + + +class PublishSnapshot7Test(BaseTest): + """ + publish snapshot: double publish under root + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap7 from mirror gnuplot-maverick", + "aptly publish snapshot snap7", + ] + runCmd = "aptly publish snapshot snap7" + expectedCode = 1 + + +class PublishSnapshot8Test(BaseTest): + """ + publish snapshot: double publish under prefix + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap8 from mirror gnuplot-maverick", + "aptly publish snapshot snap8 ./ppa", + ] + runCmd = "aptly publish snapshot snap8 ppa" + expectedCode = 1 + + +class PublishSnapshot9Test(BaseTest): + """ + publish snapshot: wrong prefix + """ + fixtureDB = True + fixtureCmds = [ + "aptly snapshot create snap9 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot snap9 ppa/dists/la" + expectedCode = 1 + + +class PublishSnapshot10Test(BaseTest): + """ + publish snapshot: wrong prefix + """ + fixtureDB = True + fixtureCmds = [ + "aptly snapshot create snap10 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot snap10 ppa/pool/la" + expectedCode = 1 + + +class PublishSnapshot11Test(BaseTest): + """ + publish snapshot: wrong prefix + """ + fixtureDB = True + fixtureCmds = [ + "aptly snapshot create snap11 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot snap11 ../la" + expectedCode = 1 + + +class PublishSnapshot12Test(BaseTest): + """ + publish snapshot: no snapshot + """ + fixtureDB = True + runCmd = "aptly publish snapshot snap12" + expectedCode = 1