Command aptly publish switch to switch published snapshot. #8

This commit is contained in:
Andrey Smirnov
2014-04-22 20:17:21 +04:00
parent 1200e9cc95
commit cc8baec317
15 changed files with 532 additions and 7 deletions
@@ -0,0 +1,29 @@
.
.
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/main/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
@@ -0,0 +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:
Cleaning up prefix "." component "main"...
Publish for snapshot ./maverick (main) [amd64, i386] publishes [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11' has been successfully switched to new snapshot.
@@ -0,0 +1,9 @@
Origin: . maverick
Label: . maverick
Codename: maverick
Architectures: amd64 i386
Components: main
Description: Generated by aptly
MD5Sum:
SHA1:
SHA256:
@@ -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/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb
Filename: pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb
Filename: pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb
Filename: pool/main/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
@@ -0,0 +1,7 @@
Loading packages...
Generating metadata files and linking package files...
Signing file '${HOME}/.aptly/public/ppa/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Clearsigning file '${HOME}/.aptly/public/ppa/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "ppa" component "main"...
Publish for snapshot ppa/maverick (main) [amd64, i386] publishes [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick has been successfully switched to new snapshot.
@@ -0,0 +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:
Cleaning up prefix "." component "main"...
Publish for snapshot ./maverick (main) [amd64, i386] publishes [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11' has been successfully switched to new snapshot.
@@ -0,0 +1,7 @@
Loading packages...
Generating metadata files and linking package files...
Signing file '${HOME}/.aptly/public/ppa/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Clearsigning file '${HOME}/.aptly/public/ppa/dists/maverick/Release.tmp' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "ppa" component "main"...
Publish for snapshot ppa/maverick (main) [i386] publishes [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick has been successfully switched to new snapshot.
@@ -0,0 +1 @@
ERROR: unable to update: published repo with prefix/distribution ppa/maverick not found
@@ -0,0 +1 @@
ERROR: unable to update: not a snapshot publish
@@ -0,0 +1 @@
ERROR: unable to switch: snapshot with name snap3 not found
+6 -5
View File
@@ -2,8 +2,9 @@
Testing publishing snapshots
"""
from .drop import *
from .list import *
from .repo import *
from .snapshot import *
from .update import *
# from .drop import *
# from .list import *
# from .repo import *
# from .snapshot import *
from .switch import *
# from .update import *
+228
View File
@@ -0,0 +1,228 @@
import os
import hashlib
import inspect
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 PublishSwitch1Test(BaseTest):
"""
publish switch: removed some packages
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot create snap2 empty",
"aptly snapshot pull -no-deps -architectures=i386,amd64 snap2 snap1 snap3 gnuplot-x11",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick snap3"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch1Test, 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.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-x11_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_not_exists('public/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_not_exists('public/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.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/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 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 PublishSwitch2Test(BaseTest):
"""
publish switch: added some packages
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot create snap2 empty",
"aptly snapshot pull -no-deps -architectures=i386,amd64 snap2 snap1 snap3 gnuplot-x11",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap3 ppa",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick ppa snap1"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch2Test, self).check()
self.check_exists('public/ppa/dists/maverick/InRelease')
self.check_exists('public/ppa/dists/maverick/Release')
self.check_exists('public/ppa/dists/maverick/Release.gpg')
self.check_exists('public/ppa/dists/maverick/main/binary-i386/Packages.gz')
self.check_exists('public/ppa/dists/maverick/main/binary-i386/Packages.bz2')
self.check_exists('public/ppa/dists/maverick/main/binary-amd64/Packages')
self.check_exists('public/ppa/dists/maverick/main/binary-amd64/Packages.gz')
self.check_exists('public/ppa/dists/maverick/main/binary-amd64/Packages.bz2')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.deb')
# verify contents except of sums
self.check_file_contents('public/ppa/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
class PublishSwitch3Test(BaseTest):
"""
publish switch: removed some packages, files occupied by another package
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot create snap2 empty",
"aptly snapshot pull -no-deps -architectures=i386,amd64 snap2 snap1 snap3 gnuplot-x11",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick2 snap1",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick snap3"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch3Test, 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.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-x11_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_exists('public/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.deb')
class PublishSwitch4Test(BaseTest):
"""
publish switch: added some packages, but list of published archs doesn't change
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot create snap2 empty",
"aptly snapshot pull -no-deps -architectures=i386 snap2 snap1 snap3 gnuplot-x11",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap3 ppa",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick ppa snap1"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch4Test, self).check()
self.check_exists('public/ppa/dists/maverick/InRelease')
self.check_exists('public/ppa/dists/maverick/Release')
self.check_exists('public/ppa/dists/maverick/Release.gpg')
self.check_exists('public/ppa/dists/maverick/main/binary-i386/Packages.gz')
self.check_exists('public/ppa/dists/maverick/main/binary-i386/Packages.bz2')
self.check_not_exists('public/ppa/dists/maverick/main/binary-amd64/Packages')
self.check_not_exists('public/ppa/dists/maverick/main/binary-amd64/Packages.gz')
self.check_not_exists('public/ppa/dists/maverick/main/binary-amd64/Packages.bz2')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_i386.deb')
self.check_not_exists('public/ppa/pool/main/g/gnuplot/gnuplot-x11_4.6.1-1~maverick2_amd64.deb')
self.check_exists('public/ppa/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_i386.deb')
self.check_not_exists('public/ppa/pool/main/g/gnuplot/gnuplot-nox_4.6.1-1~maverick2_amd64.deb')
class PublishSwitch5Test(BaseTest):
"""
publish switch: no such publish
"""
fixtureCmds = [
"aptly snapshot create snap1 empty",
]
runCmd = "aptly publish switch maverick ppa snap1"
expectedCode = 1
class PublishSwitch6Test(BaseTest):
"""
publish switch: not a snapshot
"""
fixtureCmds = [
"aptly snapshot create snap1 empty",
"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",
]
runCmd = "aptly publish switch maverick snap1"
expectedCode = 1
class PublishSwitch7Test(BaseTest):
"""
publish switch: no snapshot
"""
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 -distribution=maverick snap1",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick snap3"
expectedCode = 1