System tests for aptly publish switch with multiple repositories. #36

This commit is contained in:
Andrey Smirnov
2014-06-07 15:18:58 +04:00
parent 17b320eac4
commit 17ed34fdaa
9 changed files with 301 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
Published repositories:
* ./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ppa/maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {contrib: [snap2]: Merged from sources: 'snap1'}
* ppa/maverick [amd64, i386] publishes {contrib: [snap2]: Merged from sources: 'snap1'}, {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ppa/smira/wheezy [amd64] publishes {contrib: [snap2]: Merged from sources: 'snap1'}
* ppa/tr1/maverick (origin: origin1) [amd64, i386] publishes {main: [snap2]: Merged from sources: 'snap1'}
* ppa/tr2/maverick (label: label1) [amd64, i386] publishes {main: [snap2]: Merged from sources: 'snap1'}

View File

@@ -0,0 +1,109 @@
.
.
.
.
.
.
.
.
C-like language. Can perform smoothing, spline-fitting, or nonlinear fits,
C-like language. Can perform smoothing, spline-fitting, or nonlinear fits,
C-like language. Can perform smoothing, spline-fitting, or nonlinear fits,
C-like language. Can perform smoothing, spline-fitting, or nonlinear fits,
Data files and self-defined functions can be manipulated by the internal
Data files and self-defined functions can be manipulated by the internal
Data files and self-defined functions can be manipulated by the internal
Data files and self-defined functions can be manipulated by the internal
Gnuplot is a portable command-line driven interactive data and function
Gnuplot is a portable command-line driven interactive data and function
Gnuplot is a portable command-line driven interactive data and function
Gnuplot is a portable command-line driven interactive data and function
This package contains the additional documentation.
This package contains the terminal driver that enables gnuplot to plot
This package is for transition and to install a full-featured gnuplot
This package is for working without an X server.
and can work with complex numbers.
and can work with complex numbers.
and can work with complex numbers.
and can work with complex numbers.
for many printers, (La)TeX, (x)fig, Postscript, and so on. The X11-output
for many printers, (La)TeX, (x)fig, Postscript, and so on. The X11-output
for many printers, (La)TeX, (x)fig, Postscript, and so on. The X11-output
for many printers, (La)TeX, (x)fig, Postscript, and so on. The X11-output
gnuplot.
images interactively under X11. Most users will want this, it is however
is packaged in gnuplot-x11.
is packaged in gnuplot-x11.
is packaged in gnuplot-x11.
is packaged in gnuplot-x11.
packaged separately so that low-end systems don't need X installed to use
plotting utility that supports lots of output formats, including drivers
plotting utility that supports lots of output formats, including drivers
plotting utility that supports lots of output formats, including drivers
plotting utility that supports lots of output formats, including drivers
supporting the X11-output.
Architecture: all
Architecture: all
Architecture: i386
Architecture: i386
Depends: dpkg (>= 1.15.4) | install-info
Depends: gnuplot-nox (>= 4.6.1-1~maverick2), gnuplot-x11 (>= 4.6.1-1~maverick2)
Depends: gnuplot-nox (>= 4.6.1-1~maverick2), libc6 (>= 2.11), libcairo2 (>= 1.6.0), libedit2 (>= 2.5.cvs.20010821-1), libgcc1 (>= 1:4.1.1), libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm (>= 2.0.36~rc1~dfsg), libglib2.0-0 (>= 2.12.0), liblua5.1-0, libpango1.0-0 (>= 1.14.0), libstdc++6 (>= 4.1.1), libwxbase2.8-0 (>= 2.8.11.0), libwxgtk2.8-0 (>= 2.8.11.0), libx11-6
Depends: libc6 (>= 2.11), libcairo2 (>= 1.6.0), libedit2 (>= 2.5.cvs.20010821-1), libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm (>= 2.0.36~rc1~dfsg), libglib2.0-0 (>= 2.12.0), liblua5.1-0, libpango1.0-0 (>= 1.14.0)
Description: Command-line driven interactive plotting program
Description: Command-line driven interactive plotting program
Description: Command-line driven interactive plotting program
Description: Command-line driven interactive plotting program
Filename: pool/a/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb
Filename: pool/a/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb
Filename: pool/a/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb
Filename: pool/a/g/gnuplot/gnuplot_4.6.1-1~maverick2_all.deb
Installed-Size: 1604
Installed-Size: 20
Installed-Size: 2536
Installed-Size: 5572
MD5sum: 25a5028811171f2f1fa157a2f6953e82
MD5sum: 4912a4464d5588f685c4aa6cfc6be46c
MD5sum: a7ef16004b62fd78acb77edb058ea1c1
MD5sum: fcad938905d0ace50a6ce0c73b2c6583
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Package: gnuplot
Package: gnuplot-doc
Package: gnuplot-nox
Package: gnuplot-x11
Priority: optional
Priority: optional
Priority: optional
Priority: optional
Recommends: groff, ttf-liberation
Replaces: gnuplot (<< 4.0.0)
Replaces: gnuplot (<< 4.0.0)
SHA1: 02f9a93097a8f798a054e26154dbe5789088c069
SHA1: 4a50deb413e05f77b31687405465b1229b3be328
SHA1: 629c3e62f787b0af47b184beb0460dd261c9ca4d
SHA1: 837dd002143054ca01d3b01cae410cc4b4fe10c4
Section: doc
Section: math
Section: math
Section: math
Size: 1046
Size: 1046496
Size: 2675242
Size: 724388
Source:
Source: gnuplot
Source: gnuplot
Source: gnuplot
Suggests: gnuplot-doc (>= 4.6.1-1~maverick2)
Suggests: gnuplot-x11 (>= 4.6.1-1~maverick2), gnuplot-doc (>= 4.6.1-1~maverick2)
Version: 4.6.1-1~maverick2
Version: 4.6.1-1~maverick2
Version: 4.6.1-1~maverick2
Version: 4.6.1-1~maverick2

View File

@@ -0,0 +1,30 @@
.
.
C-like language. Can perform smoothing, spline-fitting, or nonlinear fits,
Data files and self-defined functions can be manipulated by the internal
Gnuplot is a portable command-line driven interactive data and function
This package contains the terminal driver that enables gnuplot to plot
and can work with complex numbers.
for many printers, (La)TeX, (x)fig, Postscript, and so on. The X11-output
gnuplot.
images interactively under X11. Most users will want this, it is however
is packaged in gnuplot-x11.
packaged separately so that low-end systems don't need X installed to use
plotting utility that supports lots of output formats, including drivers
Architecture: i386
Depends: gnuplot-nox (>= 4.6.1-1~maverick2), libc6 (>= 2.11), libcairo2 (>= 1.6.0), libedit2 (>= 2.5.cvs.20010821-1), libgcc1 (>= 1:4.1.1), libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm (>= 2.0.36~rc1~dfsg), libglib2.0-0 (>= 2.12.0), liblua5.1-0, libpango1.0-0 (>= 1.14.0), libstdc++6 (>= 4.1.1), libwxbase2.8-0 (>= 2.8.11.0), libwxgtk2.8-0 (>= 2.8.11.0), libx11-6
Description: Command-line driven interactive plotting program
Filename: pool/b/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb
Installed-Size: 1604
MD5sum: fcad938905d0ace50a6ce0c73b2c6583
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Package: gnuplot-x11
Priority: optional
Replaces: gnuplot (<< 4.0.0)
SHA1: 02f9a93097a8f798a054e26154dbe5789088c069
Section: math
Size: 724388
Source: gnuplot
Version: 4.6.1-1~maverick2

View File

@@ -0,0 +1,26 @@
(name, value) pairs from the user, via conventional methods such as
.
.
Boost version (currently 1.49).
Library to let program developers obtain program options, that is
This package forms part of the Boost C++ Libraries collection.
This package is a dependency package, which depends on Debian's default
command line and config file.
Architecture: i386
Depends: libboost-program-options1.49-dev
Description: program options library for C++ (default version)
Filename: pool/c/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb
Homepage: http://www.boost.org/libs/program_options/
Installed-Size: 26
MD5sum: 0035d7822b2f8f0ec4013f270fd650c2
Maintainer: Debian Boost Team <pkg-boost-devel@lists.alioth.debian.org>
Package: libboost-program-options-dev
Priority: optional
SHA1: 36895eb64cfe89c33c0a2f7ac2f0c6e0e889e04b
SHA256: c76b4bd12fd92e4dfe1b55b18a67a669d92f62985d6a96c8a21d96120982cf12
Section: libdevel
Size: 2738
Source: boost-defaults
Version: 1.49.0.1

View File

@@ -0,0 +1,7 @@
Loading packages...
Generating metadata files and linking package files...
Signing file '/Users/smira/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Clearsigning file '/Users/smira/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components b, c...
Publish for snapshot ./maverick [amd64, i386, source] publishes {a: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {b: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'}, {c: [local2]: Snapshot from local repo [local-repo]} has been successfully switched to new snapshot.

View File

@@ -0,0 +1,9 @@
Origin: . maverick
Label: . maverick
Codename: maverick
Architectures: amd64 i386
Components: a b c
Description: Generated by aptly
MD5Sum:
SHA1:
SHA256:

View File

@@ -0,0 +1 @@
ERROR: unable to parse command

View File

@@ -4,4 +4,4 @@ Signing file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please
Clearsigning file '${HOME}/.aptly/public/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components contrib, main...
Publish for local repo ./maverick [i386, source] publishes {main: [repo1]}, {contrib: [repo2]} has been successfully updated.
Publish for local repo ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated.

View File

@@ -226,3 +226,120 @@ class PublishSwitch7Test(BaseTest):
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick snap3"
expectedCode = 1
class PublishSwitch8Test(BaseTest):
"""
publish switch: multi-component switching
"""
fixtureDB = True
fixturePoolCopy = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot create snap2 empty",
"aptly repo create local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create local1 from repo local-repo",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=a,b,c snap1 snap2 local1",
"aptly snapshot pull -no-deps -architectures=i386,amd64 snap2 snap1 snap3 gnuplot-x11",
"aptly repo remove local-repo pyspi",
"aptly snapshot create local2 from repo local-repo",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -component=b,c maverick snap3 local2"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch8Test, self).check()
self.check_exists('public/dists/maverick/InRelease')
self.check_exists('public/dists/maverick/Release')
self.check_exists('public/dists/maverick/Release.gpg')
for component in ("a", "b", "c"):
self.check_exists('public/dists/maverick/' + component + '/binary-i386/Packages')
self.check_exists('public/dists/maverick/' + component + '/binary-i386/Packages.gz')
self.check_exists('public/dists/maverick/' + component + '/binary-i386/Packages.bz2')
self.check_exists('public/dists/maverick/' + component + '/binary-amd64/Packages')
self.check_exists('public/dists/maverick/' + component + '/binary-amd64/Packages.gz')
self.check_exists('public/dists/maverick/' + component + '/binary-amd64/Packages.bz2')
self.check_exists('public/dists/maverick/' + component + '/source/Sources')
self.check_exists('public/dists/maverick/' + component + '/source/Sources.gz')
self.check_exists('public/dists/maverick/' + component + '/source/Sources.bz2')
self.check_exists('public/pool/a/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/a/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/pool/a/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/a/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/pool/b/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/b/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_not_exists('public/pool/b/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_not_exists('public/pool/b/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/pool/c/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb')
self.check_not_exists('public/pool/c/p/pyspi/pyspi_0.6.1-1.3.dsc')
self.check_not_exists('public/pool/c/p/pyspi/pyspi_0.6.1-1.3.diff.gz')
self.check_not_exists('public/pool/c/p/pyspi/pyspi_0.6.1.orig.tar.gz')
self.check_not_exists('public/pool/c/p/pyspi/pyspi-0.6.1-1.3.stripped.dsc')
# 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/a/binary-i386/Packages', 'binaryA', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
self.check_file_contents('public/dists/maverick/b/binary-i386/Packages', 'binaryB', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
self.check_file_contents('public/dists/maverick/c/binary-i386/Packages', 'binaryC', 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 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(['a/binary-amd64/Packages', 'c/source/Sources', 'c/binary-amd64/Packages.bz2', 'b/binary-amd64/Packages',
'a/source/Sources', 'a/binary-i386/Packages.bz2', 'b/source/Sources.bz2', 'b/binary-amd64/Packages.bz2',
'c/binary-i386/Packages', 'a/binary-i386/Packages', 'c/binary-amd64/Packages', 'a/source/Sources.gz',
'b/binary-i386/Packages.gz', 'c/binary-amd64/Packages.gz', 'a/binary-amd64/Packages.bz2', 'c/source/Sources.bz2',
'c/source/Sources.gz', 'a/source/Sources.bz2', 'b/binary-i386/Packages.bz2', 'a/binary-i386/Packages.gz',
'a/binary-amd64/Packages.gz', 'c/binary-i386/Packages.bz2', 'b/binary-amd64/Packages.gz', 'b/source/Sources',
'c/binary-i386/Packages.gz', 'b/source/Sources.gz', 'b/binary-i386/Packages']):
raise Exception("path seen wrong: %r" % (pathsSeen, ))
class PublishSwitch9Test(BaseTest):
"""
publish switch: components/snapshots mismatch
"""
fixtureCmds = [
"aptly snapshot create snap1 empty",
"aptly snapshot create snap2 empty",
"aptly publish snapshot -architectures=i386 -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=a,b snap1 snap2",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -component=a,b maverick snap2"
expectedCode = 2
outputMatchPrepare = lambda _, s: "\n".join([l for l in s.split("\n") if l.startswith("ERROR")])