System tests for aptly repo move|copy.

This commit is contained in:
Andrey Smirnov
2014-02-27 18:06:13 +04:00
parent a45d2f3ce9
commit abe9a37408
34 changed files with 385 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1 @@
ERROR: unable to determine list of architectures, please specify explicitly

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,4 @@
Name: repo2
Comment: Cool
Number of packages: 0
Packages:

View File

@@ -0,0 +1 @@
ERROR: unable to copy: unable to parse dependency: pyspi >> 0.6.1-1.3)

View File

@@ -0,0 +1 @@
ERROR: unable to copy: source and destination are the same

View File

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

View File

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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
Name: repo1
Comment: Cool
Number of packages: 1
Packages:
pyspi_0.6.1-1.3_source

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
Name: repo1
Comment: Cool
Number of packages: 1
Packages:
pyspi_0.6.1-1.3_source

View File

@@ -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

View File

@@ -0,0 +1 @@
ERROR: unable to determine list of architectures, please specify explicitly

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,4 @@
Name: repo2
Comment: Cool
Number of packages: 0
Packages:

View File

@@ -0,0 +1 @@
ERROR: unable to move: unable to parse dependency: pyspi >> 0.6.1-1.3)

View File

@@ -0,0 +1 @@
ERROR: unable to move: source and destination are the same

View File

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

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -3,8 +3,10 @@ Testing local repo management
"""
from .add import *
from .copy import *
from .create import *
from .drop import *
from .list import *
from .move import *
from .remove import *
from .show import *

120
system/t09_repo/copy.py Normal file
View File

@@ -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

120
system/t09_repo/move.py Normal file
View File

@@ -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

View File

@@ -3,7 +3,7 @@ from lib import BaseTest
class RemoveRepo1Test(BaseTest):
"""
remvoe from local repo: as dep
remove from local repo: as dep
"""
fixtureCmds = [
"aptly repo create -comment=Cool local-repo",
@@ -21,7 +21,7 @@ class RemoveRepo1Test(BaseTest):
class RemoveRepo2Test(BaseTest):
"""
remvoe from local repo: as dep with version, key
remove from local repo: as dep with version, key
"""
fixtureCmds = [
"aptly repo create -comment=Cool local-repo",
@@ -39,7 +39,26 @@ class RemoveRepo2Test(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"
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")))