Add -json flag to mirror list|show

Signed-off-by: Joshua Colson <joshua.colson@gmail.com>
This commit is contained in:
Joshua Colson
2021-09-21 14:37:13 -07:00
committed by Lorenzo Bolla
parent d582f9bab2
commit 129eb8644d
17 changed files with 816 additions and 12 deletions
+40
View File
@@ -40,3 +40,43 @@ class ShowMirror4Test(BaseTest):
def outputMatchPrepare(self, s):
return re.sub(r"(Date|Valid-Until): [,0-9:+A-Za-z -]+\n", "", s)
class ShowMirror5Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create --ignore-signatures mirror1 http://cdn-fastly.deb.debian.org/debian/ stretch"]
runCmd = "aptly mirror show -json mirror1"
def outputMatchPrepare(_, s):
return re.sub(r'[ ]*"UUID": "[\w-]+",?\n', '', s)
class ShowMirror6Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show -json mirror-xx"
expectedCode = 1
class ShowMirror7Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show -json --with-packages wheezy-contrib"
class ShowMirror8Test(BaseTest):
"""
show mirror: mirror with filter
"""
fixtureCmds = [
"aptly mirror create -ignore-signatures -filter='nginx | Priority (required)' -filter-with-deps=true mirror4 http://security.debian.org/ stretch/updates main"
]
runCmd = "aptly mirror show -json mirror4"
def outputMatchPrepare(self, s):
return re.sub(r'[ ]*"UUID": "[\w-]+",?\n', '', s)