From 3c7a4ac8186fe1307bac6857bfdb48fc190ed57f Mon Sep 17 00:00:00 2001 From: Brandon Mitchell Date: Tue, 19 Dec 2023 16:09:58 -0500 Subject: [PATCH] Blob delete permits the 405 response code Signed-off-by: Brandon Mitchell --- conformance/04_management_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conformance/04_management_test.go b/conformance/04_management_test.go index 1fabe432..695c7bb4 100644 --- a/conformance/04_management_test.go +++ b/conformance/04_management_test.go @@ -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() { @@ -147,7 +148,11 @@ var test04ContentManagement = func() { req := client.NewRequest(reggie.DELETE, "/v2//blobs/", 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//blobs/", reggie.WithDigest(layerBlobDigest)) resp, err = client.Do(req) @@ -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//blobs/", reggie.WithDigest(configs[3].Digest)) resp, err := client.Do(req) Expect(err).To(BeNil())