Added support for NotAutomatic, ButAutomaticUpgrades and Origin fields

This commit is contained in:
Oliver Sauder
2017-05-23 15:30:57 +02:00
parent 39293d7faf
commit e3f1880ad4
33 changed files with 171 additions and 65 deletions

View File

@@ -95,13 +95,15 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
Component string
Name string `binding:"required"`
} `binding:"required"`
Distribution string
Label string
Origin string
ForceOverwrite bool
SkipContents *bool
Architectures []string
Signing SigningOptions
Distribution string
Label string
Origin string
NotAutomatic string
ButAutomaticUpgrades string
ForceOverwrite bool
SkipContents *bool
Architectures []string
Signing SigningOptions
}
if !c.Bind(&b) {
@@ -183,7 +185,15 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
c.Fail(500, fmt.Errorf("unable to publish: %s", err))
return
}
published.Origin = b.Origin
if b.Origin != "" {
published.Origin = b.Origin
}
if b.NotAutomatic != "" {
published.NotAutomatic = b.NotAutomatic
}
if b.ButAutomaticUpgrades != "" {
published.ButAutomaticUpgrades = b.ButAutomaticUpgrades
}
published.Label = b.Label
published.SkipContents = context.Config().SkipContentsPublishing

View File

@@ -500,7 +500,7 @@ _aptly()
"snapshot"|"repo")
if [[ $numargs -eq 0 ]]; then
if [[ "$cur" == -* ]]; then
COMPREPLY=($(compgen -W "-batch -force-overwrite -distribution= -component= -gpg-key= -keyring= -label= -origin= -passphrase= -passphrase-file= -secret-keyring= -skip-contents -skip-signing" -- ${cur}))
COMPREPLY=($(compgen -W "-batch -force-overwrite -distribution= -component= -gpg-key= -keyring= -label= -origin= -notautomatic= -butautomaticupgrades= -passphrase= -passphrase-file= -secret-keyring= -skip-contents -skip-signing" -- ${cur}))
else
if [[ "$subcmd" == "snapshot" ]]; then
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))

View File

@@ -43,6 +43,8 @@ Example:
cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG")
cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes")
cmd.Flag.String("origin", "", "origin name to publish")
cmd.Flag.String("notautomatic", "", "set value for NotAutomatic field")
cmd.Flag.String("butautomaticupgrades", "", "set value for ButAutomaticUpgrades field")
cmd.Flag.String("label", "", "label to publish")
cmd.Flag.Bool("force-overwrite", false, "overwrite files in package pool in case of mismatch")

View File

@@ -112,12 +112,23 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
}
distribution := context.Flags().Lookup("distribution").Value.String()
origin := context.Flags().Lookup("origin").Value.String()
notAutomatic := context.Flags().Lookup("notautomatic").Value.String()
butAutomaticUpgrades := context.Flags().Lookup("butautomaticupgrades").Value.String()
published, err := deb.NewPublishedRepo(storage, prefix, distribution, context.ArchitecturesList(), components, sources, context.CollectionFactory())
if err != nil {
return fmt.Errorf("unable to publish: %s", err)
}
published.Origin = context.Flags().Lookup("origin").Value.String()
if origin != "" {
published.Origin = origin
}
if notAutomatic != "" {
published.NotAutomatic = notAutomatic
}
if butAutomaticUpgrades != "" {
published.ButAutomaticUpgrades = butAutomaticUpgrades
}
published.Label = context.Flags().Lookup("label").Value.String()
published.SkipContents = context.Config().SkipContentsPublishing
@@ -211,7 +222,9 @@ Example:
cmd.Flag.Bool("batch", false, "run GPG with detached tty")
cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG")
cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes")
cmd.Flag.String("origin", "", "origin name to publish")
cmd.Flag.String("origin", "", "overwrite origin name to publish")
cmd.Flag.String("notautomatic", "", "overwrite value for NotAutomatic field")
cmd.Flag.String("butautomaticupgrades", "", "overwrite value for ButAutomaticUpgrades field")
cmd.Flag.String("label", "", "label to publish")
cmd.Flag.Bool("force-overwrite", false, "overwrite files in package pool in case of mismatch")

View File

@@ -22,6 +22,8 @@ var (
"Version",
"Codename",
"Date",
"NotAutomatic",
"ButAutomaticUpgrades",
"Architectures",
"Architecture",
"Components",

View File

@@ -37,11 +37,13 @@ type PublishedRepo struct {
// Internal unique ID
UUID string
// Storage & Prefix & distribution should be unique across all published repositories
Storage string
Prefix string
Distribution string
Origin string
Label string
Storage string
Prefix string
Distribution string
Origin string
NotAutomatic string
ButAutomaticUpgrades string
Label string
// Architectures is a list of all architectures published
Architectures []string
// SourceKind is "local"/"repo"
@@ -167,6 +169,7 @@ func NewPublishedRepo(storage, prefix, distribution string, architectures []stri
component string
snapshot *Snapshot
localRepo *LocalRepo
fields = make(map[string][]string)
)
// get first source
@@ -214,6 +217,16 @@ func NewPublishedRepo(storage, prefix, distribution string, architectures []stri
snapshot = source.(*Snapshot)
result.Sources[component] = snapshot.UUID
result.sourceItems[component] = repoSourceItem{snapshot: snapshot}
if !utils.StrSliceHasItem(fields["Origin"], snapshot.Origin) {
fields["Origin"] = append(fields["Origin"], snapshot.Origin)
}
if !utils.StrSliceHasItem(fields["NotAutomatic"], snapshot.NotAutomatic) {
fields["NotAutomatic"] = append(fields["NotAutomatic"], snapshot.NotAutomatic)
}
if !utils.StrSliceHasItem(fields["ButAutomaticUpgrades"], snapshot.ButAutomaticUpgrades) {
fields["ButAutomaticUpgrades"] = append(fields["ButAutomaticUpgrades"], snapshot.ButAutomaticUpgrades)
}
} else if result.SourceKind == SourceLocalRepo {
localRepo = source.(*LocalRepo)
result.Sources[component] = localRepo.UUID
@@ -250,6 +263,17 @@ func NewPublishedRepo(storage, prefix, distribution string, architectures []stri
result.Distribution = distribution
// only fields which are unique by all given snapshots are set on published
if len(fields["Origin"]) == 1 {
result.Origin = fields["Origin"][0]
}
if len(fields["NotAutomatic"]) == 1 {
result.NotAutomatic = fields["NotAutomatic"][0]
}
if len(fields["ButAutomaticUpgrades"]) == 1 {
result.ButAutomaticUpgrades = fields["ButAutomaticUpgrades"][0]
}
return result, nil
}
@@ -276,15 +300,17 @@ func (p *PublishedRepo) MarshalJSON() ([]byte, error) {
}
return json.Marshal(map[string]interface{}{
"Architectures": p.Architectures,
"Distribution": p.Distribution,
"Label": p.Label,
"Origin": p.Origin,
"Prefix": p.Prefix,
"SourceKind": p.SourceKind,
"Sources": sources,
"Storage": p.Storage,
"SkipContents": p.SkipContents,
"Architectures": p.Architectures,
"Distribution": p.Distribution,
"Label": p.Label,
"Origin": p.Origin,
"NotAutomatic": p.NotAutomatic,
"ButAutomaticUpgrades": p.ButAutomaticUpgrades,
"Prefix": p.Prefix,
"SourceKind": p.SourceKind,
"Sources": sources,
"Storage": p.Storage,
"SkipContents": p.SkipContents,
})
}
@@ -307,19 +333,27 @@ func (p *PublishedRepo) String() string {
sources = append(sources, fmt.Sprintf("{%s: %s}", component, source))
}
var extras []string
var extra string
if p.Origin != "" {
extra += fmt.Sprintf("origin: %s", p.Origin)
extras = append(extras, fmt.Sprintf("origin: %s", p.Origin))
}
if p.NotAutomatic != "" {
extras = append(extras, fmt.Sprintf("notautomatic: %s", p.NotAutomatic))
}
if p.ButAutomaticUpgrades != "" {
extras = append(extras, fmt.Sprintf("butautomaticupgrades: %s", p.ButAutomaticUpgrades))
}
if p.Label != "" {
if extra != "" {
extra += ", "
}
extra += fmt.Sprintf("label: %s", p.Label)
extras = append(extras, fmt.Sprintf("label: %s", p.Label))
}
extra = strings.Join(extras, ", ")
if extra != "" {
extra = " (" + extra + ")"
}
@@ -674,6 +708,12 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
release := make(Stanza)
release["Origin"] = p.GetOrigin()
if p.NotAutomatic != "" {
release["NotAutomatic"] = p.NotAutomatic
}
if p.ButAutomaticUpgrades != "" {
release["ButAutomaticUpgrades"] = p.ButAutomaticUpgrades
}
release["Label"] = p.GetLabel()
release["Suite"] = p.Distribution
release["Codename"] = p.Distribution

View File

@@ -31,6 +31,10 @@ type Snapshot struct {
// Description of how snapshot was created
Description string
Origin string
NotAutomatic string
ButAutomaticUpgrades string
packageRefs *PackageRefList
}
@@ -41,13 +45,16 @@ func NewSnapshotFromRepository(name string, repo *RemoteRepo) (*Snapshot, error)
}
return &Snapshot{
UUID: uuid.New(),
Name: name,
CreatedAt: time.Now(),
SourceKind: SourceRemoteRepo,
SourceIDs: []string{repo.UUID},
Description: fmt.Sprintf("Snapshot from mirror %s", repo),
packageRefs: repo.packageRefs,
UUID: uuid.New(),
Name: name,
CreatedAt: time.Now(),
SourceKind: SourceRemoteRepo,
SourceIDs: []string{repo.UUID},
Description: fmt.Sprintf("Snapshot from mirror %s", repo),
Origin: repo.Meta["Origin"],
NotAutomatic: repo.Meta["NotAutomatic"],
ButAutomaticUpgrades: repo.Meta["ButAutomaticUpgrades"],
packageRefs: repo.packageRefs,
}, nil
}

View File

@@ -1340,6 +1340,10 @@ Options:
run GPG with detached tty
.
.TP
\-\fBbutautomaticupgrades\fR=
set value for ButAutomaticUpgrades field
.
.TP
\-\fBcomponent\fR=
component name to publish (for multi\-component publishing, separate components with commas)
.
@@ -1364,6 +1368,10 @@ GPG keyring to use (instead of default)
label to publish
.
.TP
\-\fBnotautomatic\fR=
set value for NotAutomatic field
.
.TP
\-\fBorigin\fR=
origin name to publish
.
@@ -1427,6 +1435,10 @@ Options:
run GPG with detached tty
.
.TP
\-\fBbutautomaticupgrades\fR=
overwrite value for ButAutomaticUpgrades field
.
.TP
\-\fBcomponent\fR=
component name to publish (for multi\-component publishing, separate components with commas)
.
@@ -1451,8 +1463,12 @@ GPG keyring to use (instead of default)
label to publish
.
.TP
\-\fBnotautomatic\fR=
overwrite value for NotAutomatic field
.
.TP
\-\fBorigin\fR=
origin name to publish
overwrite origin name to publish
.
.TP
\-\fBpassphrase\fR=

View File

@@ -1,3 +1,3 @@
Snapshot `snap1` is published currently:
* ./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
ERROR: unable to drop: snapshot is published

View File

@@ -1,3 +1,3 @@
Snapshot `snap1` is published currently:
* ./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
ERROR: unable to drop: snapshot is published

View File

@@ -1,4 +1,4 @@
Snapshot `snap1` is published currently:
* filesystem:hardlink:./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* filesystem:symlink:./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* filesystem:hardlink:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* filesystem:symlink:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
ERROR: unable to drop: snapshot is published

View File

@@ -1,5 +1,5 @@
Published repositories:
* ./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ppa/maverick [amd64, i386] publishes {contrib: [snap2]: Merged from sources: 'snap1'}, {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
* ppa/smira/wheezy [amd64] publishes {contrib: [snap2]: Merged from sources: 'snap1'}
* ppa/tr1/maverick (origin: origin1) [amd64, i386] publishes {main: [snap2]: Merged from sources: 'snap1'}

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Suite: maverick
Codename: maverick

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Suite: maverick
Codename: maverick

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Suite: maverick
Codename: maverick

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Suite: maverick
Codename: maverick

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Archive: maverick
Architecture: amd64

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Archive: maverick
Architecture: i386

View File

@@ -2,6 +2,8 @@ Origin: aptly24
Label: . squeeze
Suite: squeeze
Codename: squeeze
NotAutomatic: yes
ButAutomaticUpgrades: yes
Architectures: amd64 i386
Components: main
Description: Generated by aptly

View File

@@ -1,4 +1,4 @@
Origin: . squeeze
Origin: LP-PPA-gladky-anton-gnuplot
Label: . squeeze
Suite: squeeze
Codename: squeeze

View File

@@ -1,4 +1,4 @@
Origin: . wheezy
Origin: Debian
Label: . wheezy
Suite: wheezy
Codename: wheezy

View File

@@ -1,4 +1,4 @@
Origin: . wheezy
Origin: Debian
Label: . wheezy
Archive: wheezy
Architecture: i386

View File

@@ -1,4 +1,4 @@
Origin: . squeeze
Origin: LP-PPA-gladky-anton-gnuplot
Label: . squeeze
Suite: squeeze
Codename: squeeze

View File

@@ -1,4 +1,4 @@
Origin: . squeeze
Origin: LP-PPA-gladky-anton-gnuplot
Label: . squeeze
Suite: squeeze
Codename: squeeze

View File

@@ -1 +1 @@
ERROR: prefix/distribution already used by another published repo: ./maverick [amd64, i386] publishes {main: [snap7]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
ERROR: prefix/distribution already used by another published repo: ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap7]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}

View File

@@ -1 +1 @@
ERROR: prefix/distribution already used by another published repo: ppa/maverick [amd64, i386] publishes {main: [snap8]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
ERROR: prefix/distribution already used by another published repo: ppa/maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap8]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}

View File

@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.

View File

@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.

View File

@@ -1,4 +1,4 @@
Origin: . maverick
Origin: LP-PPA-gladky-anton-gnuplot
Label: . maverick
Suite: maverick
Codename: maverick

View File

@@ -5,4 +5,4 @@ Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components main...
Publish for snapshot ./maverick [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.
Publish for snapshot ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot.

View File

@@ -608,14 +608,14 @@ class PublishSnapshot23Test(BaseTest):
class PublishSnapshot24Test(BaseTest):
"""
publish snapshot: custom origin
publish snapshot: custom origin, notautomatic and butautomaticupgrades
"""
fixtureDB = True
fixturePool = True
fixtureCmds = [
"aptly snapshot create snap24 from mirror gnuplot-maverick",
]
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze -origin=aptly24 snap24"
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze -origin=aptly24 -notautomatic=yes -butautomaticupgrades=yes snap24"
gold_processor = BaseTest.expand_environ
def check(self):

View File

@@ -1,11 +1,11 @@
Serving published repositories, recommended apt sources list:
# ./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
# ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
deb http://127.0.0.1:8765/ maverick main
# debian/maverick [amd64, i386, source] publishes {main: [snap2]: Snapshot from mirror [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]}
# debian/maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386, source] publishes {main: [snap2]: Snapshot from mirror [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]}
deb http://127.0.0.1:8765/debian/ maverick main
deb-src http://127.0.0.1:8765/debian/ maverick main
# multi/maverick [amd64, i386, source] publishes {contrib: [snap2]: Snapshot from mirror [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]}, {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
# multi/maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386, source] publishes {contrib: [snap2]: Snapshot from mirror [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]}, {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
deb http://127.0.0.1:8765/multi/ maverick contrib main
deb-src http://127.0.0.1:8765/multi/ maverick contrib main

View File

@@ -40,6 +40,8 @@ class PublishAPITestRepo(APITest):
'Distribution': 'wheezy',
'Label': '',
'Origin': '',
'NotAutomatic': '',
'ButAutomaticUpgrades': '',
'Prefix': prefix,
'SkipContents': False,
'SourceKind': 'local',
@@ -74,6 +76,8 @@ class PublishAPITestRepo(APITest):
'Distribution': distribution,
'Label': '',
'Origin': '',
'NotAutomatic': '',
'ButAutomaticUpgrades': '',
'Prefix': ".",
'SkipContents': False,
'SourceKind': 'local',
@@ -120,6 +124,8 @@ class PublishSnapshotAPITest(APITest):
"Sources": [{"Name": snapshot_name}],
"Signing": DefaultSigningOptions,
"Distribution": "squeeze",
"NotAutomatic": "yes",
"ButAutomaticUpgrades": "yes",
})
self.check_equal(resp.status_code, 201)
self.check_equal(resp.json(), {
@@ -127,6 +133,8 @@ class PublishSnapshotAPITest(APITest):
'Distribution': 'squeeze',
'Label': '',
'Origin': '',
'NotAutomatic': 'yes',
'ButAutomaticUpgrades': 'yes',
'Prefix': prefix,
'SkipContents': False,
'SourceKind': 'snapshot',
@@ -188,6 +196,8 @@ class PublishUpdateAPITestRepo(APITest):
'Distribution': 'wheezy',
'Label': '',
'Origin': '',
'NotAutomatic': '',
'ButAutomaticUpgrades': '',
'Prefix': prefix,
'SkipContents': False,
'SourceKind': 'local',
@@ -239,6 +249,8 @@ class PublishSwitchAPITestRepo(APITest):
'Architectures': ['i386', 'source'],
'Distribution': 'wheezy',
'Label': '',
'NotAutomatic': '',
'ButAutomaticUpgrades': '',
'Origin': '',
'Prefix': prefix,
'SkipContents': False,
@@ -272,6 +284,8 @@ class PublishSwitchAPITestRepo(APITest):
'Distribution': 'wheezy',
'Label': '',
'Origin': '',
'NotAutomatic': '',
'ButAutomaticUpgrades': '',
'Prefix': prefix,
'SkipContents': True,
'SourceKind': 'snapshot',