Support for per-repo uploader.json in aptly repo commands. #71

This commit is contained in:
Andrey Smirnov
2015-03-22 19:02:20 +03:00
parent a160a39d53
commit 8b782ce370
15 changed files with 152 additions and 8 deletions
+3
View File
@@ -0,0 +1,3 @@
Local repo [repo4] successfully added.
You can run 'aptly repo add repo4 ...' to add packages to repository.
@@ -0,0 +1,6 @@
Name: repo4
Comment:
Default Distribution:
Default Component: main
Uploaders: {"groups":{"developers":["21DBB89C16DB3E6D","37E1C17570096AD1"]},"rules":[{"condition":"Source (dangerous) | Source (kernel)","allow":null,"deny":["*"]},{"condition":"Source (hardlink)","allow":["developers","admins"],"deny":null}]}
Number of packages: 0
+1
View File
@@ -0,0 +1 @@
ERROR: error loading uploaders file: unexpected EOF
+1
View File
@@ -0,0 +1 @@
ERROR: error loading uploaders file: open /uploaders-not-found.json: no such file or directory
+1
View File
@@ -0,0 +1 @@
Local repo [repo4] successfully updated.
+6
View File
@@ -0,0 +1,6 @@
Name: repo4
Comment:
Default Distribution:
Default Component: main
Uploaders: {"groups":{"developers":["21DBB89C16DB3E6D","37E1C17570096AD1"]},"rules":[{"condition":"Source (dangerous) | Source (kernel)","allow":null,"deny":["*"]},{"condition":"Source (hardlink)","allow":["developers","admins"],"deny":null}]}
Number of packages: 0
+1
View File
@@ -0,0 +1 @@
ERROR: error loading uploaders file: unexpected EOF
+1
View File
@@ -0,0 +1 @@
ERROR: error loading uploaders file: open /uploaders-not-found.json: no such file or directory
+1
View File
@@ -0,0 +1 @@
Local repo [repo7] successfully updated.
+5
View File
@@ -0,0 +1,5 @@
Name: repo7
Comment:
Default Distribution:
Default Component: main
Number of packages: 0
+33
View File
@@ -1,6 +1,11 @@
import os
import inspect
from lib import BaseTest
changesRemove = lambda _, s: s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class CreateRepo1Test(BaseTest):
"""
create local repo: regular repo
@@ -30,3 +35,31 @@ class CreateRepo3Test(BaseTest):
fixtureCmds = ["aptly repo create repo3"]
runCmd = "aptly repo create -comment=Repository3 repo3"
expectedCode = 1
class CreateRepo4Test(BaseTest):
"""
create local repo: with uploaders.json
"""
runCmd = "aptly repo create -uploaders-file=${changes}/uploaders2.json repo4"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo4", "repo_show")
class CreateRepo5Test(BaseTest):
"""
create local repo: with broken uploaders.json
"""
runCmd = "aptly repo create -uploaders-file=${changes}/uploaders3.json repo5"
expectedCode = 1
class CreateRepo6Test(BaseTest):
"""
create local repo: with missing uploaders.json
"""
runCmd = "aptly repo create -uploaders-file=${changes}/uploaders-not-found.json repo6"
expectedCode = 1
outputMatchPrepare = changesRemove
+56
View File
@@ -1,6 +1,11 @@
import os
import inspect
from lib import BaseTest
changesRemove = lambda _, s: s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
@@ -35,3 +40,54 @@ class EditRepo3Test(BaseTest):
"""
runCmd = "aptly repo edit repo3"
expectedCode = 1
class EditRepo4Test(BaseTest):
"""
edit repo: add uploaders.json
"""
fixtureCmds = [
"aptly repo create repo4",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders2.json repo4"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo4", "repo_show")
class EditRepo5Test(BaseTest):
"""
edit repo: with broken uploaders.json
"""
fixtureCmds = [
"aptly repo create repo5",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders3.json repo5"
expectedCode = 1
class EditRepo6Test(BaseTest):
"""
edit local repo: with missing uploaders.json
"""
fixtureCmds = [
"aptly repo create repo6",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders-not-found.json repo6"
expectedCode = 1
outputMatchPrepare = changesRemove
class EditRepo7Test(BaseTest):
"""
edit local repo: remove uploaders.json
"""
fixtureCmds = [
"aptly repo create -uploaders-file=${changes}/uploaders2.json repo7",
]
runCmd = "aptly repo edit -uploaders-file= repo7"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo7", "repo_show")