@@ -19,53 +19,37 @@ var test03ContentDiscovery = func() {
1919 var tagList []string
2020
2121 g .Context ("Setup" , func () {
22- g .Specify ("Populate registry with test blobs" , func () {
23- SkipIfDisabled (contentDiscovery )
24- RunOnlyIf (runContentDiscoverySetup )
25- for i := 1 ; i <= 2 ; i ++ {
26- req := client .NewRequest (reggie .POST , "/v2/<name>/blobs/uploads/" )
27- resp , err := client .Do (req )
28- Expect (err ).To (BeNil ())
29- req = client .NewRequest (reggie .PUT , resp .GetRelativeLocation ()).
30- SetQueryParam ("digest" , configs [i ].Digest ).
31- SetHeader ("Content-Type" , "application/octet-stream" ).
32- SetHeader ("Content-Length" , configs [i ].ContentLength ).
33- SetBody (configs [i ].Content )
34- resp , err = client .Do (req )
35- Expect (err ).To (BeNil ())
36- Expect (resp .StatusCode ()).To (SatisfyAll (
37- BeNumerically (">=" , 200 ),
38- BeNumerically ("<" , 300 )))
39- }
40- })
41-
42- g .Specify ("Populate registry with test layer" , func () {
22+ g .Specify ("Populate registry with test blob" , func () {
4323 SkipIfDisabled (contentDiscovery )
4424 RunOnlyIf (runContentDiscoverySetup )
4525 req := client .NewRequest (reggie .POST , "/v2/<name>/blobs/uploads/" )
4626 resp , err := client .Do (req )
4727 Expect (err ).To (BeNil ())
4828 req = client .NewRequest (reggie .PUT , resp .GetRelativeLocation ()).
49- SetQueryParam ("digest" , layerBlobDigest ).
29+ SetQueryParam ("digest" , configs [ 2 ]. Digest ).
5030 SetHeader ("Content-Type" , "application/octet-stream" ).
51- SetHeader ("Content-Length" , layerBlobContentLength ).
52- SetBody (layerBlobData )
31+ SetHeader ("Content-Length" , configs [ 2 ]. ContentLength ).
32+ SetBody (configs [ 2 ]. Content )
5333 resp , err = client .Do (req )
5434 Expect (err ).To (BeNil ())
5535 Expect (resp .StatusCode ()).To (SatisfyAll (
5636 BeNumerically (">=" , 200 ),
5737 BeNumerically ("<" , 300 )))
5838 })
5939
60- g .Specify ("Populate registry with referred-to manifest " , func () {
40+ g .Specify ("Populate registry with test layer " , func () {
6141 SkipIfDisabled (contentDiscovery )
6242 RunOnlyIf (runContentDiscoverySetup )
63- req := client .NewRequest (reggie .PUT , "/v2/<name>/manifests/<reference>" ,
64- reggie .WithReference ("test-something-points-to-me" )).
65- SetHeader ("Content-Type" , "application/vnd.oci.image.manifest.v1+json" ).
66- SetBody (manifests [1 ].Content )
43+ req := client .NewRequest (reggie .POST , "/v2/<name>/blobs/uploads/" )
6744 resp , err := client .Do (req )
6845 Expect (err ).To (BeNil ())
46+ req = client .NewRequest (reggie .PUT , resp .GetRelativeLocation ()).
47+ SetQueryParam ("digest" , layerBlobDigest ).
48+ SetHeader ("Content-Type" , "application/octet-stream" ).
49+ SetHeader ("Content-Length" , layerBlobContentLength ).
50+ SetBody (layerBlobData )
51+ resp , err = client .Do (req )
52+ Expect (err ).To (BeNil ())
6953 Expect (resp .StatusCode ()).To (SatisfyAll (
7054 BeNumerically (">=" , 200 ),
7155 BeNumerically ("<" , 300 )))
@@ -141,19 +125,6 @@ var test03ContentDiscovery = func() {
141125 Expect (len (tagList )).To (BeNumerically ("<=" , numResults ))
142126 Expect (tagList ).To (ContainElement (tagList [numResults - 1 ]))
143127 })
144-
145- g .Specify ("GET request to list of referrers should yield 200 response" , func () {
146- SkipIfDisabled (contentDiscovery )
147- // TODO: should move to this form per the spec,
148- // the endpoint used is supported currently by oci-playground/distribution
149- // req := client.NewRequest(reggie.GET, "/v2/<name>/referrers/<digest>", reggie.WithDigest(manifests[2].Digest))
150- req := client .NewRequest (reggie .GET , "/v2/<name>/_oci/artifacts/referrers" )
151- // set the digest to the one being pointed to by manifests[2]
152- req .QueryParam .Add ("digest" , manifests [1 ].Digest )
153- resp , err := client .Do (req )
154- Expect (err ).To (BeNil ())
155- Expect (resp .StatusCode ()).To (Equal (http .StatusOK ))
156- })
157128 })
158129
159130 g .Context ("Teardown" , func () {
0 commit comments