mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
System tests for aptly repo move|copy.
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 copied
|
||||||
|
[o] pyspi_0.6.1-1.4_source copied
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 3
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 2
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 copied
|
||||||
|
[o] pyspi_0.6.1-1.4_source copied
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 3
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 2
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to determine list of architectures, please specify explicitly
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Changes not saved, as dry run has been requested.
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 copied
|
||||||
|
[o] pyspi_0.6.1-1.4_source copied
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 3
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 0
|
||||||
|
Packages:
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to copy: unable to parse dependency: pyspi >> 0.6.1-1.3)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to copy: source and destination are the same
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to copy: local repo with name repo2 not found
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to copy: local repo with name repo1 not found
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 moved
|
||||||
|
[o] pyspi_0.6.1-1.4_source moved
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 1
|
||||||
|
Packages:
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 2
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 moved
|
||||||
|
[o] pyspi_0.6.1-1.4_source moved
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 1
|
||||||
|
Packages:
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 2
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to determine list of architectures, please specify explicitly
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Changes not saved, as dry run has been requested.
|
||||||
|
Loading packages...
|
||||||
|
[o] libboost-program-options-dev_1.49.0.1_i386 moved
|
||||||
|
[o] pyspi_0.6.1-1.4_source moved
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Name: repo1
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 3
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Name: repo2
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 0
|
||||||
|
Packages:
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to move: unable to parse dependency: pyspi >> 0.6.1-1.3)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to move: source and destination are the same
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to move: local repo with name repo2 not found
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ERROR: unable to move: local repo with name repo1 not found
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Changes not saved, as dry run has been requested.
|
||||||
|
Loading packages...
|
||||||
|
[-] libboost-program-options-dev_1.49.0.1_i386 removed
|
||||||
|
[-] pyspi_0.6.1-1.4_source removed
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Name: local-repo
|
||||||
|
Comment: Cool
|
||||||
|
Number of packages: 3
|
||||||
|
Packages:
|
||||||
|
libboost-program-options-dev_1.49.0.1_i386
|
||||||
|
pyspi_0.6.1-1.3_source
|
||||||
|
pyspi_0.6.1-1.4_source
|
||||||
@@ -3,8 +3,10 @@ Testing local repo management
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from .add import *
|
from .add import *
|
||||||
|
from .copy import *
|
||||||
from .create import *
|
from .create import *
|
||||||
from .drop import *
|
from .drop import *
|
||||||
from .list import *
|
from .list import *
|
||||||
|
from .move import *
|
||||||
from .remove import *
|
from .remove import *
|
||||||
from .show import *
|
from .show import *
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
from lib import BaseTest
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo1Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: simple copy
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo2Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: simple copy w/deps
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly -architectures=i386,amd64 repo copy -with-deps repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo3Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: simple copy w/deps but w/o archs
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy -with-deps repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo4Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: dry run
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy -dry-run repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo5Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: wrong dep
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy repo1 repo2 'pyspi >> 0.6.1-1.3)'"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo6Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: same src and dest
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy repo1 repo1 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo7Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: no dst
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy repo1 repo2 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class CopyRepo8Test(BaseTest):
|
||||||
|
"""
|
||||||
|
copy in local repo: no src
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo copy repo1 repo2 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
from lib import BaseTest
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo1Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: simple move
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo2Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: simple move w/deps
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly -architectures=i386,amd64 repo move -with-deps repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo3Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: simple move w/deps but w/o archs
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move -with-deps repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo4Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: dry run
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move -dry-run repo1 repo2 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo1", "repo1_show")
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages repo2", "repo2_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo5Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: wrong dep
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
"aptly repo add repo1 ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move repo1 repo2 'pyspi >> 0.6.1-1.3)'"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo6Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: same src and dest
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move repo1 repo1 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo7Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: no dst
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo1",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move repo1 repo2 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class MoveRepo8Test(BaseTest):
|
||||||
|
"""
|
||||||
|
move in local repo: no src
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool repo2",
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo move repo1 repo2 pyspi"
|
||||||
|
expectedCode = 1
|
||||||
@@ -3,7 +3,7 @@ from lib import BaseTest
|
|||||||
|
|
||||||
class RemoveRepo1Test(BaseTest):
|
class RemoveRepo1Test(BaseTest):
|
||||||
"""
|
"""
|
||||||
remvoe from local repo: as dep
|
remove from local repo: as dep
|
||||||
"""
|
"""
|
||||||
fixtureCmds = [
|
fixtureCmds = [
|
||||||
"aptly repo create -comment=Cool local-repo",
|
"aptly repo create -comment=Cool local-repo",
|
||||||
@@ -21,7 +21,7 @@ class RemoveRepo1Test(BaseTest):
|
|||||||
|
|
||||||
class RemoveRepo2Test(BaseTest):
|
class RemoveRepo2Test(BaseTest):
|
||||||
"""
|
"""
|
||||||
remvoe from local repo: as dep with version, key
|
remove from local repo: as dep with version, key
|
||||||
"""
|
"""
|
||||||
fixtureCmds = [
|
fixtureCmds = [
|
||||||
"aptly repo create -comment=Cool local-repo",
|
"aptly repo create -comment=Cool local-repo",
|
||||||
@@ -39,7 +39,26 @@ class RemoveRepo2Test(BaseTest):
|
|||||||
|
|
||||||
class RemoveRepo3Test(BaseTest):
|
class RemoveRepo3Test(BaseTest):
|
||||||
"""
|
"""
|
||||||
remvoe from local repo: no such repo
|
remove from local repo: no such repo
|
||||||
"""
|
"""
|
||||||
runCmd = "aptly repo remove local-repo 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
runCmd = "aptly repo remove local-repo 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
expectedCode = 1
|
expectedCode = 1
|
||||||
|
|
||||||
|
|
||||||
|
class RemoveRepo4Test(BaseTest):
|
||||||
|
"""
|
||||||
|
remove from local repo: dry run
|
||||||
|
"""
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly repo create -comment=Cool local-repo",
|
||||||
|
"aptly repo add local-repo ${files}"
|
||||||
|
]
|
||||||
|
runCmd = "aptly repo remove -dry-run local-repo 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
self.check_output()
|
||||||
|
self.check_cmd_output("aptly repo show -with-packages local-repo", "repo_show")
|
||||||
|
|
||||||
|
def output_processor(self, output):
|
||||||
|
return "\n".join(sorted(output.split("\n")))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user