Skip to content

Commit

Permalink
Merge pull request #499 from sudo-bmitch/pr-blob-delete-405
Browse files Browse the repository at this point in the history
Blob delete permits the 405 response code
  • Loading branch information
mikebrow committed Jan 11, 2024
2 parents 961602b + 3c7a4ac commit a12c8d7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions conformance/04_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var test04ContentManagement = func() {
const defaultTagName = "tagtest0"
var tagToDelete string
var numTags int
var blobDeleteAllowed = true

g.Context("Setup", func() {
g.Specify("Populate registry with test config blob", func() {
Expand Down Expand Up @@ -147,7 +148,11 @@ var test04ContentManagement = func() {
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusAccepted),
Equal(http.StatusNotFound),
Equal(http.StatusMethodNotAllowed),
))
// layer blob
req = client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(layerBlobDigest))
resp, err = client.Do(req)
Expand All @@ -156,12 +161,17 @@ var test04ContentManagement = func() {
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusAccepted),
Equal(http.StatusNotFound),
))
Equal(http.StatusMethodNotAllowed),
))
if resp.StatusCode() == http.StatusMethodNotAllowed {
blobDeleteAllowed = false
}
})

g.Specify("GET request to deleted blob URL should yield 404 response", func() {
SkipIfDisabled(contentManagement)
RunOnlyIf(runContentManagementSetup)
RunOnlyIf(blobDeleteAllowed)
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expand Down

0 comments on commit a12c8d7

Please sign in to comment.