Skip to content

Commit

Permalink
conformance: delete the empty manifest in teardown
Browse files Browse the repository at this point in the history
emptyLayerManifest is being pushed but not deleted during teardown

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha committed Jun 21, 2023
1 parent 8879931 commit 1ea7ad4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions conformance/02_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var test02Push = func() {
g.Context(titlePush, func() {

var lastResponse, prevResponse *reggie.Response
var emptyLayerManifestRef string

g.Context("Setup", func() {
// No setup required at this time for push tests
Expand Down Expand Up @@ -358,6 +359,7 @@ var test02Push = func() {
Expect(err).To(BeNil())
if resp.StatusCode() == http.StatusCreated {
location := resp.Header().Get("Location")
emptyLayerManifestRef = location
Expect(location).ToNot(BeEmpty())
Expect(resp.StatusCode()).To(Equal(http.StatusCreated))
} else {
Expand Down Expand Up @@ -390,6 +392,18 @@ var test02Push = func() {
),
Equal(http.StatusMethodNotAllowed),
))
if emptyLayerManifestRef != "" {
req = client.NewRequest(reggie.DELETE, emptyLayerManifestRef)
resp, err = client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAny(
SatisfyAll(
BeNumerically(">=", 200),
BeNumerically("<", 300),
),
Equal(http.StatusMethodNotAllowed),
))
}
})
}

Expand Down Expand Up @@ -437,6 +451,18 @@ var test02Push = func() {
),
Equal(http.StatusMethodNotAllowed),
))
if emptyLayerManifestRef != "" {
req = client.NewRequest(reggie.DELETE, emptyLayerManifestRef)
resp, err = client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAny(
SatisfyAll(
BeNumerically(">=", 200),
BeNumerically("<", 300),
),
Equal(http.StatusMethodNotAllowed),
))
}
})
}
})
Expand Down

0 comments on commit 1ea7ad4

Please sign in to comment.