From 532c85eaa6aadb687c094d3eb43dd2d65edd596b Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 18 Feb 2014 00:49:17 +0400 Subject: [PATCH] Test for publihsing snapshot with sources. --- system/t06_publish/PublishSnapshot16Test_gold | 10 ++++ .../t06_publish/PublishSnapshot16Test_release | 9 ++++ .../t06_publish/PublishSnapshot16Test_sources | 27 +++++++++++ system/t06_publish/snapshot.py | 46 +++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 system/t06_publish/PublishSnapshot16Test_gold create mode 100644 system/t06_publish/PublishSnapshot16Test_release create mode 100644 system/t06_publish/PublishSnapshot16Test_sources diff --git a/system/t06_publish/PublishSnapshot16Test_gold b/system/t06_publish/PublishSnapshot16Test_gold new file mode 100644 index 00000000..acb1e5b8 --- /dev/null +++ b/system/t06_publish/PublishSnapshot16Test_gold @@ -0,0 +1,10 @@ +Signing file '/Users/smira/.aptly/public/dists/maverick/Release' with gpg, please enter your passphrase when prompted: +Clearsigning file '/Users/smira/.aptly/public/dists/maverick/Release' with gpg, please enter your passphrase when prompted: + +Snapshot snap16 has been successfully published. +Please setup your webserver to serve directory '/Users/smira/.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/PublishSnapshot16Test_release b/system/t06_publish/PublishSnapshot16Test_release new file mode 100644 index 00000000..9444c59b --- /dev/null +++ b/system/t06_publish/PublishSnapshot16Test_release @@ -0,0 +1,9 @@ +Origin: . maverick +Label: . maverick +Codename: maverick +Architectures: amd64 i386 +Components: main +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/PublishSnapshot16Test_sources b/system/t06_publish/PublishSnapshot16Test_sources new file mode 100644 index 00000000..bbfed290 --- /dev/null +++ b/system/t06_publish/PublishSnapshot16Test_sources @@ -0,0 +1,27 @@ +Package: gnuplot +Version: 4.6.1-1~maverick2 +Section: math +Maintainer: Debian Science Team +Architecture: any all +Format: 3.0 (quilt) +Standards-Version: 3.8.4 +Checksums-Sha1: 1ea21a628223159b0297ae65fe8293afd5aab3c0 4959670 gnuplot_4.6.1.orig.tar.gz + 2dd7bd3ee9abf89a0c2d518dfea56e7cbf01e0c2 18955 gnuplot_4.6.1-1~maverick2.debian.tar.gz +Checksums-Sha256: f4bf99907d0fea7db90b6e50147f1730b5bde2fbb93d9e58478b6b94409eebc6 4959670 gnuplot_4.6.1.orig.tar.gz + e1e3ad5ad145cf7909a029a4dba6b9fffb5faabc3bc6b5099a3d6a92c7b5da2c 18955 gnuplot_4.6.1-1~maverick2.debian.tar.gz +Uploaders: Bradley Smith , Anton Gladky +Vcs-Git: git://git.debian.org/git/debian-science/packages/gnuplot.git +Binary: gnuplot, gnuplot-nox, gnuplot-x11, gnuplot-doc +Dm-Upload-Allowed: yes +Directory: pool/main/g/gnuplot +Vcs-Browser: http://git.debian.org/?p=debian-science/packages/gnuplot.git +Homepage: http://gnuplot.sourceforge.net/ +Files: 4c9a06461f402482c30cf94e267eb877 4959670 gnuplot_4.6.1.orig.tar.gz + 103201f00bd80a7408dfb0e0b630eb14 18955 gnuplot_4.6.1-1~maverick2.debian.tar.gz + 021df43737184e40b1ef8cef3cbd18b9 2431 gnuplot_4.6.1-1~maverick2.dsc +Package-List: gnuplot deb math optional + gnuplot-doc deb doc optional + gnuplot-nox deb math optional + gnuplot-x11 deb math optional +Build-Depends: debhelper (>= 7), libpng-dev, libx11-dev, libxt-dev, pkg-config, texinfo (>= 4.8), texlive-latex-base, texlive-latex-recommended, texlive-latex-extra, liblua5.1-dev, zlib1g-dev, libgd2-noxpm-dev, quilt, libwxgtk2.8-dev, libcairo2-dev, libpango1.0-dev, libedit-dev, autoconf, automake + diff --git a/system/t06_publish/snapshot.py b/system/t06_publish/snapshot.py index 406963fd..e351a7ff 100644 --- a/system/t06_publish/snapshot.py +++ b/system/t06_publish/snapshot.py @@ -360,3 +360,49 @@ class PublishSnapshot15Test(BaseTest): # verify contents except of sums self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor) + + +class PublishSnapshot16Test(BaseTest): + """ + publish snapshot: with sources + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap16 from mirror gnuplot-maverick-src", + ] + runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap16" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot16Test, 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/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/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + self.check_exists('public/pool/main/g/gnuplot/gnuplot_4.6.1-1~maverick2.debian.tar.gz') + self.check_exists('public/pool/main/g/gnuplot/gnuplot_4.6.1-1~maverick2.dsc') + self.check_exists('public/pool/main/g/gnuplot/gnuplot_4.6.1.orig.tar.gz') + + # 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")))) + + # verify signatures + self.run_cmd(["gpg", "--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", "--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')])