mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
System tests for mirror/repo/snapshot rename commands. #63
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
Mirror wheezy-main -> wheezy-main-cool has been successfully renamed.
|
||||||
@@ -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>`.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: mirror with name wheezy-main not found
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: mirror wheezy-contrib already exists
|
||||||
@@ -7,3 +7,4 @@ from .show import *
|
|||||||
from .list import *
|
from .list import *
|
||||||
from .update import *
|
from .update import *
|
||||||
from .drop import *
|
from .drop import *
|
||||||
|
from .rename import *
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
Snapshot snapshot1 -> snapshot2 has been successfully renamed.
|
||||||
@@ -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>`.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: snapshot with name snapshot2 not found
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: snapshot snapshot4 already exists
|
||||||
@@ -10,3 +10,4 @@ from .pull import *
|
|||||||
from .diff import *
|
from .diff import *
|
||||||
from .merge import *
|
from .merge import *
|
||||||
from .drop import *
|
from .drop import *
|
||||||
|
from .rename import *
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
Local repo repo1 -> repo2 has been successfully renamed.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
List of local repos:
|
||||||
|
* [repo2] (packages: 0)
|
||||||
|
|
||||||
|
To get more information about local repository, run `aptly repo show <name>`.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: local repo with name repo2 not found
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to rename: local repo repo4 already exists
|
||||||
@@ -12,3 +12,4 @@ from .list import *
|
|||||||
from .move import *
|
from .move import *
|
||||||
from .remove import *
|
from .remove import *
|
||||||
from .show import *
|
from .show import *
|
||||||
|
from .rename import *
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user