Add -json flag to publish list|show

Signed-off-by: Joshua Colson <joshua.colson@gmail.com>
This commit is contained in:
Joshua Colson
2021-09-21 18:46:59 -07:00
committed by Lorenzo Bolla
parent 129eb8644d
commit 899ed92ebc
11 changed files with 302 additions and 52 deletions
+1
View File
@@ -0,0 +1 @@
[]
+97
View File
@@ -0,0 +1,97 @@
[
{
"AcquireByHash": false,
"Architectures": [
"amd64",
"i386"
],
"ButAutomaticUpgrades": "",
"Distribution": "maverick",
"Label": "",
"NotAutomatic": "",
"Origin": "LP-PPA-gladky-anton-gnuplot",
"Path": "./maverick",
"Prefix": ".",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "main",
"Name": "snap1"
}
],
"Storage": "",
"Suite": ""
},
{
"AcquireByHash": false,
"Architectures": [
"amd64"
],
"ButAutomaticUpgrades": "",
"Distribution": "wheezy",
"Label": "",
"NotAutomatic": "",
"Origin": "",
"Path": "ppa/smira/wheezy",
"Prefix": "ppa/smira",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "contrib",
"Name": "snap2"
}
],
"Storage": "",
"Suite": ""
},
{
"AcquireByHash": false,
"Architectures": [
"amd64",
"i386"
],
"ButAutomaticUpgrades": "",
"Distribution": "maverick",
"Label": "",
"NotAutomatic": "",
"Origin": "origin1",
"Path": "ppa/tr1/maverick",
"Prefix": "ppa/tr1",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "main",
"Name": "snap2"
}
],
"Storage": "",
"Suite": ""
},
{
"AcquireByHash": false,
"Architectures": [
"amd64",
"i386"
],
"ButAutomaticUpgrades": "",
"Distribution": "maverick",
"Label": "label1",
"NotAutomatic": "",
"Origin": "",
"Path": "ppa/tr2/maverick",
"Prefix": "ppa/tr2",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "main",
"Name": "snap2"
}
],
"Storage": "",
"Suite": ""
}
]
+24
View File
@@ -0,0 +1,24 @@
{
"AcquireByHash": false,
"Architectures": [
"amd64",
"i386"
],
"ButAutomaticUpgrades": "",
"Distribution": "maverick",
"Label": "",
"NotAutomatic": "",
"Origin": "LP-PPA-gladky-anton-gnuplot",
"Path": "./maverick",
"Prefix": ".",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "main",
"Name": "snap1"
}
],
"Storage": "",
"Suite": ""
}
+24
View File
@@ -0,0 +1,24 @@
{
"AcquireByHash": false,
"Architectures": [
"amd64",
"i386"
],
"ButAutomaticUpgrades": "",
"Distribution": "maverick",
"Label": "",
"NotAutomatic": "",
"Origin": "LP-PPA-gladky-anton-gnuplot",
"Path": "ppa/smira/maverick",
"Prefix": "ppa/smira",
"SkipContents": false,
"SourceKind": "snapshot",
"Sources": [
{
"Component": "main",
"Name": "snap1"
}
],
"Storage": "",
"Suite": ""
}
+24
View File
@@ -41,3 +41,27 @@ class PublishList3Test(BaseTest):
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -label=label1 snap2 ppa/tr2",
]
runCmd = "aptly publish list -raw"
class PublishList4Test(BaseTest):
"""
publish list json: empty list
"""
runCmd = "aptly publish list -json"
class PublishList5Test(BaseTest):
"""
publish list json: several repos list
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly snapshot merge snap2 snap1",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1",
"aptly -architectures=amd64 publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=wheezy -component=contrib snap2 ppa/smira",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -origin=origin1 snap2 ppa/tr1",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -label=label1 snap2 ppa/tr2",
]
runCmd = "aptly publish list -json"
+26
View File
@@ -25,3 +25,29 @@ class PublishShow2Test(BaseTest):
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 ppa/smira",
]
runCmd = "aptly publish show maverick ppa/smira"
class PublishShow3Test(BaseTest):
"""
publish show json: existing snapshot
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1",
]
runCmd = "aptly publish show -json maverick"
class PublishShow4Test(BaseTest):
"""
publish show json: under prefix
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror gnuplot-maverick",
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 ppa/smira",
]
runCmd = "aptly publish show -json maverick ppa/smira"