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 17, 2023
1 parent 6731bd3 commit 05d66c7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 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,16 @@ var test02Push = func() {
),
Equal(http.StatusMethodNotAllowed),
))
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 +449,16 @@ var test02Push = func() {
),
Equal(http.StatusMethodNotAllowed),
))
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 05d66c7

Please sign in to comment.