mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
System tests for aptly repo move|copy.
This commit is contained in:
4
system/t09_repo/CopyRepo1Test_gold
Normal file
4
system/t09_repo/CopyRepo1Test_gold
Normal 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
|
||||
7
system/t09_repo/CopyRepo1Test_repo1_show
Normal file
7
system/t09_repo/CopyRepo1Test_repo1_show
Normal 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
|
||||
6
system/t09_repo/CopyRepo1Test_repo2_show
Normal file
6
system/t09_repo/CopyRepo1Test_repo2_show
Normal 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
|
||||
4
system/t09_repo/CopyRepo2Test_gold
Normal file
4
system/t09_repo/CopyRepo2Test_gold
Normal 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
|
||||
7
system/t09_repo/CopyRepo2Test_repo1_show
Normal file
7
system/t09_repo/CopyRepo2Test_repo1_show
Normal 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
|
||||
6
system/t09_repo/CopyRepo2Test_repo2_show
Normal file
6
system/t09_repo/CopyRepo2Test_repo2_show
Normal 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
|
||||
1
system/t09_repo/CopyRepo3Test_gold
Normal file
1
system/t09_repo/CopyRepo3Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to determine list of architectures, please specify explicitly
|
||||
6
system/t09_repo/CopyRepo4Test_gold
Normal file
6
system/t09_repo/CopyRepo4Test_gold
Normal 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
|
||||
7
system/t09_repo/CopyRepo4Test_repo1_show
Normal file
7
system/t09_repo/CopyRepo4Test_repo1_show
Normal 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
|
||||
4
system/t09_repo/CopyRepo4Test_repo2_show
Normal file
4
system/t09_repo/CopyRepo4Test_repo2_show
Normal file
@@ -0,0 +1,4 @@
|
||||
Name: repo2
|
||||
Comment: Cool
|
||||
Number of packages: 0
|
||||
Packages:
|
||||
1
system/t09_repo/CopyRepo5Test_gold
Normal file
1
system/t09_repo/CopyRepo5Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to copy: unable to parse dependency: pyspi >> 0.6.1-1.3)
|
||||
1
system/t09_repo/CopyRepo6Test_gold
Normal file
1
system/t09_repo/CopyRepo6Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to copy: source and destination are the same
|
||||
1
system/t09_repo/CopyRepo7Test_gold
Normal file
1
system/t09_repo/CopyRepo7Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to copy: local repo with name repo2 not found
|
||||
1
system/t09_repo/CopyRepo8Test_gold
Normal file
1
system/t09_repo/CopyRepo8Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to copy: local repo with name repo1 not found
|
||||
4
system/t09_repo/MoveRepo1Test_gold
Normal file
4
system/t09_repo/MoveRepo1Test_gold
Normal 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
|
||||
5
system/t09_repo/MoveRepo1Test_repo1_show
Normal file
5
system/t09_repo/MoveRepo1Test_repo1_show
Normal file
@@ -0,0 +1,5 @@
|
||||
Name: repo1
|
||||
Comment: Cool
|
||||
Number of packages: 1
|
||||
Packages:
|
||||
pyspi_0.6.1-1.3_source
|
||||
6
system/t09_repo/MoveRepo1Test_repo2_show
Normal file
6
system/t09_repo/MoveRepo1Test_repo2_show
Normal 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
|
||||
4
system/t09_repo/MoveRepo2Test_gold
Normal file
4
system/t09_repo/MoveRepo2Test_gold
Normal 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
|
||||
5
system/t09_repo/MoveRepo2Test_repo1_show
Normal file
5
system/t09_repo/MoveRepo2Test_repo1_show
Normal file
@@ -0,0 +1,5 @@
|
||||
Name: repo1
|
||||
Comment: Cool
|
||||
Number of packages: 1
|
||||
Packages:
|
||||
pyspi_0.6.1-1.3_source
|
||||
6
system/t09_repo/MoveRepo2Test_repo2_show
Normal file
6
system/t09_repo/MoveRepo2Test_repo2_show
Normal 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
|
||||
1
system/t09_repo/MoveRepo3Test_gold
Normal file
1
system/t09_repo/MoveRepo3Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to determine list of architectures, please specify explicitly
|
||||
6
system/t09_repo/MoveRepo4Test_gold
Normal file
6
system/t09_repo/MoveRepo4Test_gold
Normal 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
|
||||
7
system/t09_repo/MoveRepo4Test_repo1_show
Normal file
7
system/t09_repo/MoveRepo4Test_repo1_show
Normal 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
|
||||
4
system/t09_repo/MoveRepo4Test_repo2_show
Normal file
4
system/t09_repo/MoveRepo4Test_repo2_show
Normal file
@@ -0,0 +1,4 @@
|
||||
Name: repo2
|
||||
Comment: Cool
|
||||
Number of packages: 0
|
||||
Packages:
|
||||
1
system/t09_repo/MoveRepo5Test_gold
Normal file
1
system/t09_repo/MoveRepo5Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to move: unable to parse dependency: pyspi >> 0.6.1-1.3)
|
||||
1
system/t09_repo/MoveRepo6Test_gold
Normal file
1
system/t09_repo/MoveRepo6Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to move: source and destination are the same
|
||||
1
system/t09_repo/MoveRepo7Test_gold
Normal file
1
system/t09_repo/MoveRepo7Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to move: local repo with name repo2 not found
|
||||
1
system/t09_repo/MoveRepo8Test_gold
Normal file
1
system/t09_repo/MoveRepo8Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to move: local repo with name repo1 not found
|
||||
6
system/t09_repo/RemoveRepo4Test_gold
Normal file
6
system/t09_repo/RemoveRepo4Test_gold
Normal 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
|
||||
7
system/t09_repo/RemoveRepo4Test_repo_show
Normal file
7
system/t09_repo/RemoveRepo4Test_repo_show
Normal 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
|
||||
@@ -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
120
system/t09_repo/copy.py
Normal 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
120
system/t09_repo/move.py
Normal 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
|
||||
@@ -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")))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user