System tests for mirror/repo/snapshot rename commands. #63

This commit is contained in:
Andrey Smirnov
2014-07-26 17:28:16 +04:00
parent c5922737ed
commit b9c8a8d9da
18 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
Mirror wheezy-main -> wheezy-main-cool has been successfully renamed.

View File

@@ -0,0 +1,16 @@
List of mirrors:
* [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]
* [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick
* [sensu]: http://repos.sensuapp.org/apt/ sensu
* [wheezy-backports-src]: http://mirror.yandex.ru/debian/ wheezy-backports [src]
* [wheezy-backports]: http://mirror.yandex.ru/debian/ wheezy-backports
* [wheezy-contrib-src]: http://mirror.yandex.ru/debian/ wheezy [src]
* [wheezy-contrib]: http://mirror.yandex.ru/debian/ wheezy
* [wheezy-main-cool]: http://mirror.yandex.ru/debian/ wheezy
* [wheezy-main-src]: http://mirror.yandex.ru/debian/ wheezy [src]
* [wheezy-non-free-src]: http://mirror.yandex.ru/debian/ wheezy [src]
* [wheezy-non-free]: http://mirror.yandex.ru/debian/ wheezy
* [wheezy-updates-src]: http://mirror.yandex.ru/debian/ wheezy-updates [src]
* [wheezy-updates]: http://mirror.yandex.ru/debian/ wheezy-updates
To get more information about mirror, run `aptly mirror show <name>`.

View File

@@ -0,0 +1 @@
ERROR: unable to rename: mirror with name wheezy-main not found

View File

@@ -0,0 +1 @@
ERROR: unable to rename: mirror wheezy-contrib already exists

View File

@@ -7,3 +7,4 @@ from .show import *
from .list import *
from .update import *
from .drop import *
from .rename import *

View File

@@ -0,0 +1,30 @@
from lib import BaseTest
class RenameMirror1Test(BaseTest):
"""
rename mirror: regular operations
"""
fixtureDB = True
runCmd = "aptly mirror rename wheezy-main wheezy-main-cool"
def check(self):
self.check_output()
self.check_cmd_output("aptly mirror list", "mirror_list")
class RenameMirror2Test(BaseTest):
"""
rename mirror: missing mirror
"""
runCmd = "aptly mirror rename wheezy-main wheezy-main-cool"
expectedCode = 1
class RenameMirror3Test(BaseTest):
"""
rename mirror: already exists
"""
fixtureDB = True
runCmd = "aptly mirror rename wheezy-main wheezy-contrib"
expectedCode = 1

View File

@@ -0,0 +1,2 @@
Snapshot snapshot1 -> snapshot2 has been successfully renamed.

View File

@@ -0,0 +1,4 @@
List of snapshots:
* [snapshot2]: Snapshot from mirror [wheezy-contrib]: http://mirror.yandex.ru/debian/ wheezy
To get more information about snapshot, run `aptly snapshot show <name>`.

View File

@@ -0,0 +1 @@
ERROR: unable to rename: snapshot with name snapshot2 not found

View File

@@ -0,0 +1 @@
ERROR: unable to rename: snapshot snapshot4 already exists

View File

@@ -10,3 +10,4 @@ from .pull import *
from .diff import *
from .merge import *
from .drop import *
from .rename import *

View File

@@ -0,0 +1,37 @@
from lib import BaseTest
class RenameSnapshot1Test(BaseTest):
"""
rename snapshot: regular operations
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snapshot1 from mirror wheezy-contrib",
]
runCmd = "aptly snapshot rename snapshot1 snapshot2"
def check(self):
self.check_output()
self.check_cmd_output("aptly snapshot list", "snapshot_list")
class RenameSnapshot2Test(BaseTest):
"""
rename snapshot: missing snapshot
"""
runCmd = "aptly snapshot rename snapshot2 snapshot3"
expectedCode = 1
class RenameSnapshot3Test(BaseTest):
"""
rename snapshot: already exists
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snapshot3 from mirror wheezy-contrib",
"aptly snapshot create snapshot4 from mirror wheezy-contrib",
]
runCmd = "aptly snapshot rename snapshot3 snapshot4"
expectedCode = 1

View File

@@ -0,0 +1,2 @@
Local repo repo1 -> repo2 has been successfully renamed.

View File

@@ -0,0 +1,4 @@
List of local repos:
* [repo2] (packages: 0)
To get more information about local repository, run `aptly repo show <name>`.

View File

@@ -0,0 +1 @@
ERROR: unable to rename: local repo with name repo2 not found

View File

@@ -0,0 +1 @@
ERROR: unable to rename: local repo repo4 already exists

View File

@@ -12,3 +12,4 @@ from .list import *
from .move import *
from .remove import *
from .show import *
from .rename import *

35
system/t09_repo/rename.py Normal file
View File

@@ -0,0 +1,35 @@
from lib import BaseTest
class RenameRepo1Test(BaseTest):
"""
rename repo: regular operations
"""
fixtureCmds = [
"aptly repo create repo1",
]
runCmd = "aptly repo rename repo1 repo2"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo list", "repo_list")
class RenameRepo2Test(BaseTest):
"""
rename repo: missing repo
"""
runCmd = "aptly repo rename repo2 repo3"
expectedCode = 1
class RenameRepo3Test(BaseTest):
"""
rename repo: already exists
"""
fixtureCmds = [
"aptly repo create repo3",
"aptly repo create repo4",
]
runCmd = "aptly repo rename repo3 repo4"
expectedCode = 1