Skip to content

Commit

Permalink
Merge pull request opencontainers#3 from jdolitsky/remove-conformance
Browse files Browse the repository at this point in the history
Temporarily remove conformance changes
  • Loading branch information
jdolitsky authored Aug 1, 2022
2 parents b6f40f8 + b1f849f commit 462145a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 54 deletions.
55 changes: 13 additions & 42 deletions conformance/03_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,37 @@ var test03ContentDiscovery = func() {
var tagList []string

g.Context("Setup", func() {
g.Specify("Populate registry with test blobs", func() {
SkipIfDisabled(contentDiscovery)
RunOnlyIf(runContentDiscoverySetup)
for i := 1; i <= 2; i++ {
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/")
resp, err := client.Do(req)
Expect(err).To(BeNil())
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
SetQueryParam("digest", configs[i].Digest).
SetHeader("Content-Type", "application/octet-stream").
SetHeader("Content-Length", configs[i].ContentLength).
SetBody(configs[i].Content)
resp, err = client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAll(
BeNumerically(">=", 200),
BeNumerically("<", 300)))
}
})

g.Specify("Populate registry with test layer", func() {
g.Specify("Populate registry with test blob", func() {
SkipIfDisabled(contentDiscovery)
RunOnlyIf(runContentDiscoverySetup)
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/")
resp, err := client.Do(req)
Expect(err).To(BeNil())
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
SetQueryParam("digest", layerBlobDigest).
SetQueryParam("digest", configs[2].Digest).
SetHeader("Content-Type", "application/octet-stream").
SetHeader("Content-Length", layerBlobContentLength).
SetBody(layerBlobData)
SetHeader("Content-Length", configs[2].ContentLength).
SetBody(configs[2].Content)
resp, err = client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAll(
BeNumerically(">=", 200),
BeNumerically("<", 300)))
})

g.Specify("Populate registry with referred-to manifest", func() {
g.Specify("Populate registry with test layer", func() {
SkipIfDisabled(contentDiscovery)
RunOnlyIf(runContentDiscoverySetup)
req := client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
reggie.WithReference("test-something-points-to-me")).
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
SetBody(manifests[1].Content)
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/")
resp, err := client.Do(req)
Expect(err).To(BeNil())
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
SetQueryParam("digest", layerBlobDigest).
SetHeader("Content-Type", "application/octet-stream").
SetHeader("Content-Length", layerBlobContentLength).
SetBody(layerBlobData)
resp, err = client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAll(
BeNumerically(">=", 200),
BeNumerically("<", 300)))
Expand Down Expand Up @@ -141,19 +125,6 @@ var test03ContentDiscovery = func() {
Expect(len(tagList)).To(BeNumerically("<=", numResults))
Expect(tagList).To(ContainElement(tagList[numResults-1]))
})

g.Specify("GET request to list of referrers should yield 200 response", func() {
SkipIfDisabled(contentDiscovery)
// TODO: should move to this form per the spec,
// the endpoint used is supported currently by oci-playground/distribution
// req := client.NewRequest(reggie.GET, "/v2/<name>/referrers/<digest>", reggie.WithDigest(manifests[2].Digest))
req := client.NewRequest(reggie.GET, "/v2/<name>/_oci/artifacts/referrers")
// set the digest to the one being pointed to by manifests[2]
req.QueryParam.Add("digest", manifests[1].Digest)
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
})
})

g.Context("Teardown", func() {
Expand Down
3 changes: 0 additions & 3 deletions conformance/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ type Manifest struct {

// Layers is an indexed list of layers referenced by the manifest.
Layers []Descriptor `json:"layers"`

// Refers links a manifest to another existing manifest.
Refers *Descriptor `json:"refers,omitempty"`
}

// Descriptor describes the disposition of targeted content.
Expand Down
9 changes: 0 additions & 9 deletions conformance/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ func init() {
}
manifest.SchemaVersion = 2

// except for the first one, add "refers" field pointing to the last one
if i > 0 {
manifest.Refers = &Descriptor{
MediaType: "application/vnd.oci.image.manifest.v1+json",
Digest: godigest.Digest(manifests[i-1].Digest),
Size: int64(len(manifests[i-1].Content)),
}
}

manifestContent, err := json.MarshalIndent(&manifest, "", "\t")
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 462145a

Please sign in to comment.