From 27ae6c22af0deddd914202dd4c5ee6022da29e84 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Tue, 4 Apr 2023 10:36:17 -0400 Subject: [PATCH] conformance: make blob mount and upload checks more strict Signed-off-by: Jason Hall --- conformance/02_push_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/conformance/02_push_test.go b/conformance/02_push_test.go index 7a9fdea0..fa3eca34 100644 --- a/conformance/02_push_test.go +++ b/conformance/02_push_test.go @@ -277,7 +277,7 @@ var test02Push = func() { Equal(http.StatusCreated), Equal(http.StatusAccepted), )) - Expect(resp.GetRelativeLocation()).To(ContainSubstring(crossmountNamespace)) + Expect(resp.GetRelativeLocation()).To(Equal(fmt.Sprintf("/v2/%s/blobs/%s", crossmountNamespace, testBlobADigest))) lastResponse = resp }) @@ -296,8 +296,7 @@ var test02Push = func() { SkipIfDisabled(push) RunOnlyIf(lastResponse.StatusCode() == http.StatusAccepted) - loc := lastResponse.GetRelativeLocation() - Expect(loc).To(ContainSubstring("/blobs/uploads/")) + Expect(lastResponse.GetRelativeLocation()).To(HavePrefix(fmt.Sprintf("/v2/%s/blobs/uploads/", crossmountNamespace))) }) g.Specify("Cross-mounting without from, and automatic content discovery enabled should return a 201", func() {