Skip to content

Commit

Permalink
Tests for guessing publishing defaults from local repo params. #12
Browse files Browse the repository at this point in the history
  • Loading branch information
smira committed Mar 26, 2014
1 parent 0f8f43b commit 53e73c5
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 0 deletions.
13 changes: 13 additions & 0 deletions system/t06_publish/PublishRepo14Test_gold
@@ -0,0 +1,13 @@
Loading packages...
Generating metadata files and linking package files...
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:

Local repo local-repo 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 contrib
deb-src http://your-server/ maverick 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.
11 changes: 11 additions & 0 deletions system/t06_publish/PublishSnapshot20Test_gold
@@ -0,0 +1,11 @@
Loading packages...
Generating metadata files and linking package files...

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/ maverick main
deb-src 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.
1 change: 1 addition & 0 deletions system/t06_publish/PublishSnapshot21Test_gold
@@ -0,0 +1 @@
ERROR: unable to publish: unable to guess distribution name, please specify explicitly
11 changes: 11 additions & 0 deletions system/t06_publish/PublishSnapshot22Test_gold
@@ -0,0 +1,11 @@
Loading packages...
Generating metadata files and linking package files...

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/ maverick main
deb-src 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.
11 changes: 11 additions & 0 deletions system/t06_publish/PublishSnapshot23Test_gold
@@ -0,0 +1,11 @@
Loading packages...
Generating metadata files and linking package files...

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/ maverick main
deb-src 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.
34 changes: 34 additions & 0 deletions system/t06_publish/repo.py
Expand Up @@ -306,3 +306,37 @@ class PublishRepo13Test(BaseTest):
]
runCmd = "aptly publish repo --distribution=mars --skip-signing local-repo"
expectedCode = 1


class PublishRepo14Test(BaseTest):
"""
publish repo: publishing defaults from local repo
"""
fixtureCmds = [
"aptly repo create -distribution=maverick -component=contrib local-repo",
"aptly repo add local-repo ${files}",
]
runCmd = "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec local-repo"
gold_processor = BaseTest.expand_environ

def check(self):
super(PublishRepo14Test, 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/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/contrib/p/pyspi/pyspi_0.6.1-1.3.dsc')
self.check_exists('public/pool/contrib/p/pyspi/pyspi_0.6.1-1.3.diff.gz')
self.check_exists('public/pool/contrib/p/pyspi/pyspi_0.6.1.orig.tar.gz')
self.check_exists('public/pool/contrib/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')


73 changes: 73 additions & 0 deletions system/t06_publish/snapshot.py
Expand Up @@ -483,3 +483,76 @@ class PublishSnapshot19Test(BaseTest):
]
runCmd = "aptly publish snapshot -skip-signing snap5"
gold_processor = BaseTest.expand_environ


class PublishSnapshot20Test(BaseTest):
"""
publish snapshot: guess distribution from long chain including local repo
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly repo create -distribution=maverick local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create snap2 from repo local-repo",
"aptly snapshot merge snap3 snap1 snap2",

]
runCmd = "aptly publish snapshot -skip-signing snap3"
gold_processor = BaseTest.expand_environ


class PublishSnapshot21Test(BaseTest):
"""
publish snapshot: conflict in distributions
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly repo create -distribution=squeeze local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create snap2 from repo local-repo",
"aptly snapshot merge snap3 snap1 snap2",

]
runCmd = "aptly publish snapshot -skip-signing snap3"
gold_processor = BaseTest.expand_environ
expectedCode = 1


class PublishSnapshot22Test(BaseTest):
"""
publish snapshot: conflict in components
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly repo create -component=contrib -distribution=maverick local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create snap2 from repo local-repo",
"aptly snapshot merge snap3 snap1 snap2",

]
runCmd = "aptly publish snapshot -skip-signing snap3"
gold_processor = BaseTest.expand_environ


class PublishSnapshot23Test(BaseTest):
"""
publish snapshot: distribution empty plus distribution maverick
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly repo create local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create snap2 from repo local-repo",
"aptly snapshot merge snap3 snap1 snap2",

]
runCmd = "aptly publish snapshot -skip-signing snap3"
gold_processor = BaseTest.expand_environ

0 comments on commit 53e73c5

Please sign in to comment.