Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
beb6a25
[WIP] Conformance redesign
sudo-bmitch Jan 16, 2025
77b0aa1
[WIP] Log individual test success/failures
sudo-bmitch Feb 9, 2025
93d777f
[WIP] Writing junit results
sudo-bmitch Feb 9, 2025
5775f93
[WIP] Refactor runner, results, and state
sudo-bmitch Aug 11, 2025
885bbac
[WIP] Switch yaml library
sudo-bmitch Aug 11, 2025
30ec2fb
[WIP] First pass at auth
sudo-bmitch Aug 16, 2025
a3e3663
[WIP] Add http tracing output
sudo-bmitch Aug 23, 2025
d7eb8e9
[WIP] Fix bearer token handler
sudo-bmitch Aug 23, 2025
699e5b9
[WIP]: Use a redaction writer for logs
sudo-bmitch Aug 24, 2025
3189cf8
[WIP] Fix data status
sudo-bmitch Aug 25, 2025
88907ad
[WIP] Add HTML report
sudo-bmitch Sep 22, 2025
f8e30a4
[WIP] Adding config to Junit output, cleaning todos
sudo-bmitch Sep 29, 2025
2346c96
[WIP] Add logging
sudo-bmitch Sep 30, 2025
fccf21c
[WIP] Apply modernizer changes
sudo-bmitch Oct 1, 2025
6e68032
[WIP] Add a spec version
sudo-bmitch Oct 2, 2025
1db747b
[WIP] support bool environment variables
sudo-bmitch Oct 2, 2025
25a3b5c
[WIP] Return multiple errors and check headers on manifest push
sudo-bmitch Oct 13, 2025
fbb0fad
[WIP] Propagate errors from failed APIs in prep for a TestPushBlobAny…
sudo-bmitch Oct 14, 2025
8397fdb
[WIP] Blob push by any method
sudo-bmitch Oct 14, 2025
b5cec3b
[WIP] Add blob patch apis
sudo-bmitch Oct 15, 2025
8d0b459
[WIP] Fix API report
sudo-bmitch Oct 15, 2025
c8c60d9
[WIP] Add cleanup commands and track skipped tests
sudo-bmitch Oct 17, 2025
3e32b60
[WIP] Fix reporting of disabled tests
sudo-bmitch Oct 17, 2025
25ffee7
[WIP] Organize tests by data type
sudo-bmitch Oct 17, 2025
b2d1e8f
[WIP] Add blob push tests
sudo-bmitch Oct 17, 2025
b090304
[WIP] Individually test blob APIs
sudo-bmitch Oct 21, 2025
c0eaf3b
[WIP] Add get APIs
sudo-bmitch Oct 22, 2025
405839a
[WIP] Handle registry rejected requests
sudo-bmitch Oct 24, 2025
b4dc43b
[WIP] Report tested API version and commit
sudo-bmitch Oct 24, 2025
18155cb
[WIP] Pass through repo and update gen with func options
sudo-bmitch Oct 25, 2025
56bfb66
[WIP] Push manifest with a subject
sudo-bmitch Oct 27, 2025
29e9a10
[WIP] Test referrers API and reorder methods
sudo-bmitch Nov 2, 2025
38d3b6c
[WIP] Verify Content-Type header on manifest get
sudo-bmitch Nov 3, 2025
833eb66
[WIP] Add Artifact Index with a subject
sudo-bmitch Nov 3, 2025
743eac7
[WIP] Manage tags as a map to digests
sudo-bmitch Nov 3, 2025
91c66cf
[WIP] Add blob mount tests, better handle disabled APIs, and rework A…
sudo-bmitch Nov 7, 2025
20fb7b5
[WIP] Add HEAD requests
sudo-bmitch Nov 17, 2025
5ac35ee
[WIP] Add tag listing after push
sudo-bmitch Nov 23, 2025
6a3e4b7
[WIP] Verify delete operations
sudo-bmitch Nov 24, 2025
6179149
[WIP] Configurable data tests
sudo-bmitch Nov 25, 2025
58b8abb
[WIP] Add foreign layers and artifact as index
sudo-bmitch Nov 26, 2025
9affefb
[WIP] Add and verify unique annotations and artifactType in referrers…
sudo-bmitch Nov 27, 2025
d76ffac
[WIP] Add custom fields
sudo-bmitch Nov 27, 2025
95387c4
[WIP] Switch to upstream image structs
sudo-bmitch Nov 27, 2025
d528b83
[WIP] Allow report sections to be collapsed
sudo-bmitch Nov 28, 2025
aaaa536
[WIP] Save computed config to results
sudo-bmitch Nov 28, 2025
486c837
[WIP] Cleanup report CSS alignment
sudo-bmitch Nov 28, 2025
a12b917
[WIP] Convert legacy environment variables
sudo-bmitch Nov 30, 2025
c120a64
[WIP] Support read-only registries
sudo-bmitch Dec 2, 2025
1f07501
[WIP] Convert legacy variables for read-only registries and improve e…
sudo-bmitch Dec 3, 2025
c03846a
[WIP] Add a readme
sudo-bmitch Dec 4, 2025
ff1e957
[WIP] Improve test on referrers response descriptors
sudo-bmitch Dec 4, 2025
4f1ce68
[WIP] Add Docker image
sudo-bmitch Dec 4, 2025
a3c026e
[WIP] Add a test wrapper, but warn when used
sudo-bmitch Dec 4, 2025
6777d40
[WIP] Allow the empty blob test to be disabled, fix empty platform
sudo-bmitch Dec 4, 2025
15dd9c9
[WIP] Add Content-Length to blob APIs where required
sudo-bmitch Dec 5, 2025
5806f25
[WIP] Show expected status code in errors
sudo-bmitch Dec 5, 2025
0d5eacc
[WIP] Fix Content-Length header on requests
sudo-bmitch Dec 5, 2025
5ba2314
[WIP] Include Content-Length in debugging logs
sudo-bmitch Dec 5, 2025
b830097
[WIP] Test push of a chunk in final PUT request
sudo-bmitch Dec 5, 2025
ae3934e
[WIP] Fix Content-Length on blob mount fallback
sudo-bmitch Dec 5, 2025
33a97ee
[WIP] Test invalid blob digests
sudo-bmitch Dec 7, 2025
a9a09f4
[WIP] Fallback to PUT if blob POST with data returns Accepted
sudo-bmitch Dec 7, 2025
4e0bd02
[WIP] Add test for invalid manifest digest
sudo-bmitch Dec 9, 2025
b7e04a3
[WIP] Test out of order chunks
sudo-bmitch Dec 14, 2025
74dd810
[WIP] Test the blob upload cancel API
sudo-bmitch Dec 14, 2025
1ed476c
[WIP] Test the returned location after a push
sudo-bmitch Dec 17, 2025
f10465d
[WIP] Test sparse uploads, move upload cancel to 1.1+dev
sudo-bmitch Dec 18, 2025
e14ffff
[WIP] Test manifest with invalid digest format
sudo-bmitch Dec 23, 2025
bbc38e1
[WIP] Test missing manifests
sudo-bmitch Dec 24, 2025
92722fe
[WIP] Get a missing blob
sudo-bmitch Dec 24, 2025
ff4e02b
[WIP] Referrers on an empty repo
sudo-bmitch Jan 10, 2026
71f1f23
[WIP] Consistent error names/values
sudo-bmitch Jan 10, 2026
47e6951
[WIP] Consolidate mediaType values
sudo-bmitch Jan 10, 2026
a9a0ea0
[WIP] Test blob range requests
sudo-bmitch Jan 11, 2026
b007cae
[WIP] Empty index
sudo-bmitch Jan 20, 2026
335d913
[WIP] Artifact with empty json layer
sudo-bmitch Jan 20, 2026
15e63b8
[WIP] Distinguish between skipped and disabled
sudo-bmitch Jan 20, 2026
913cc5b
[WIP] Out of order chunked PUT returns 416
sudo-bmitch Jan 21, 2026
4d57817
[WIP] Allow filtering a branch of tests
sudo-bmitch Jan 21, 2026
b128d23
[WIP] Add image with empty layer list
sudo-bmitch Jan 21, 2026
b2f6da3
[WIP] Test "last" parameter on tag listing
sudo-bmitch Jan 21, 2026
0d12805
[WIP] Test artifactType filter on referrers list
sudo-bmitch Jan 24, 2026
ef473da
[WIP] Add the Ping API test
sudo-bmitch Jan 28, 2026
09cb1ad
[WIP] Update spec.md with conformance references
sudo-bmitch Jan 31, 2026
7018d68
[WIP] Require Docker-Content-Digest header in 1.1+dev
sudo-bmitch Feb 5, 2026
8f46804
[WIP] Fix handling of config variables
sudo-bmitch Feb 6, 2026
25c86d1
[WIP] Check all artifactTypes with referrers
sudo-bmitch Feb 7, 2026
be08608
[WIP] Add test of 4MB limit
sudo-bmitch Feb 7, 2026
cb59055
[WIP] Include disabled data tests in the results
sudo-bmitch Feb 10, 2026
89b0faa
[WIP] Generate a results.yaml
sudo-bmitch Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conformance2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!go.mod
!go.sum
conformance
conformance.test
oci-conformance.yaml
results/**
10 changes: 10 additions & 0 deletions conformance2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.24-alpine AS build

COPY . .
RUN CGO_ENABLED=0 go build -o /usr/local/bin/conformance .
ENTRYPOINT [ "/usr/local/bin/conformance" ]

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /usr/local/bin/conformance /conformance
ENTRYPOINT [ "/conformance" ]
183 changes: 183 additions & 0 deletions conformance2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# OCI Distribution Spec Conformance Test

The distribution-spec conformance test is used to verify the various HTTP endpoints on a registry generate the appropriate responses and handle different types of data.

## Configuration

The test is configured by either a yaml configuration file or environment variables.
When a setting is configured by multiple sources, the precedence from highest to lowest is the environment variable, then yaml configuration file, and lastly any legacy environment variables.

Most registries can be tested by setting the registry, repository, and login credentials.
For APIs with a valid unsupported response code, attempts are made to track the missing feature without needing to manually disable the test.

### Environment Variables

Environment variables can be used to set any configuration setting in the conformance test.
The available variables and their default values are listed here:

```shell
# several variables are used to configure the overall conformance test process
export OCI_CONFIGURATION="oci-conformance.yaml" # see Yaml Configuration File below
export OCI_RESULTS_DIR="./results" # output of the conformance test will be written here, see Results below
export OCI_VERSION="1.1" # distribution-spec version to test against, this adjusts default values for the API tests
export OCI_LOG=warn # adjust logging threshold: debug, info, warn, error (this does not affect the generated reports)

# the registry settings typically need to be configured
export OCI_REGISTRY="localhost:5000"
export OCI_TLS="enabled" # enabled (https), insecure (self signed), or disabled (http)
export OCI_REPO1="conformance/repo1"
export OCI_REPO2="conformance/repo2"
export OCI_USERNAME=
export OCI_PASSWORD=

# API settings with their 1.1 default values can be used to skip specific requests
export OCI_API_PULL=true
export OCI_API_PUSH=true # to disable push requests, see the OCI_RO_DATA variables below
export OCI_API_BLOBS_ATOMIC=true # whether blob delete operations should be immediate
export OCI_API_BLOBS_DELETE=true
export OCI_API_BLOBS_DIGEST_HEADER=false # whether Docker-Content-Digest header is required
export OCI_API_BLOBS_MOUNT_ANONYMOUS=true # attempt to mount a blob without a source repository
export OCI_API_BLOBS_UPLOAD_CANCEL=false # cancel a running upload
export OCI_API_MANIFESTS_ATOMIC=true # whether manifest delete operations should be immediate
export OCI_API_MANIFESTS_DELETE=true
export OCI_API_MANIFESTS_DIGEST_HEADER=false # whether Docker-Content-Digest header is required
export OCI_API_TAGS_ATOMIC=true # whether tag delete operations should be immediate
export OCI_API_TAGS_DELETE=true
export OCI_API_TAGS_LIST=true
export OCI_API_REFERRER=true

# Data settings are used to generate a variety of OCI content
export OCI_DATA_IMAGE=true # note, this must be left enabled for any tests to run
export OCI_DATA_INDEX=true
export OCI_DATA_INDEX_LIST=true # an index containing a nested index
export OCI_DATA_SPARSE=false # manifest where some descriptors have not been pushed
export OCI_DATA_ARTIFACT=true # an OCI artifact packaged as an image with an artifactType
export OCI_DATA_SUBJECT=true # an OCI image with the subject field defined
export OCI_DATA_SUBJECT_MISSING=true # pushes content with a subject referencing a non-existent digest
export OCI_DATA_ARTIFACT_LIST=true # an OCI index with an artifactType
export OCI_DATA_SUBJECT_LIST=true # an OCI index with the subject field defined
export OCI_DATA_DATA_FIELD=true # descriptors with the data field populated
export OCI_DATA_NONDISTRIBUTABLE=true # an OCI image containing nondistributable layer references that have not been pushed
export OCI_DATA_CUSTOM_FIELDS=true # manifests and config json with additional fields
export OCI_DATA_NO_LAYERS=true # image manifest with an empty layer list
export OCI_DATA_EMPTY_BLOB=true # zero byte blob
export OCI_DATA_SHA512=true # content pushed using the sha512 digest algorithm

# For testing read-only registries, images must be preloaded.
# OCI_API_PUSH=false must be set, and disabling DELETE APIs is recommended.
# All requests are performed against the OCI_REPO1 repository.
export OCI_RO_DATA_TAGS= # space separated list of tags
export OCI_RO_DATA_MANIFESTS= # space separated list of manifest digests
export OCI_RO_DATA_BLOBS= # space separated list of blob digests
export OCI_RO_DATA_REFERRERS= # space separated list of subject digests for the referrers API

# other settings
export OCI_FILTER_TEST= # used to filter a specific branch of tests in, e.g. "OCI Conformance Test/sha256 blobs"
```

### Yaml Configuration File

The conformance test will load `oci-conformance.yaml` by default, which can be configured with the `OCI_CONFIGURATION` environment variable.

The default yaml configuration is shown below and matches the environment variables described above:

```yaml
resultsDir: ./results
version: "1.1"
registry: localhost:5000
tls: enabled
repo1: conformance/repo1
repo2: conformance/repo2
username: ""
password: ""
logging: warn
filterTest: ""
apis:
pull: true
push: true
blobs:
atomic: true
delete: true
digestHeader: false
mountAnonymous: true
uploadCancel: false
manifests:
atomic: true
delete: true
digestHeader: false
tags:
atomic: true
delete: true
list: true
referrer: true
data:
image: true
index: true
indexList: true
sparse: false
artifact: true
subject: true
subjectMissing: true
artifactList: true
subjectList: true
dataField: true
nondistributable: true
customFields: true
noLayers: true
emptyBlob: true
sha512: true
roData:
tags: []
manifests: []
blobs: []
referrers: []
```

## Running the Test

The test is available to be run with Go, Docker, or GitHub Actions.

### Go

The tests require Go 1.24 or greater.

They can be run directly with:

```shell
go run -buildvcs=true .
```

Or to compile and run separately:

```shell
go build -o conformance .
./conformance
```

### Docker

First configure the test with environment variables or a configuration file as described above.
Then build and run the conformance test using a command similar to below:

```shell
docker build -t conformance .
docker run -it --rm --net=host \
-u "$(id -u):$(id -g)" \
-v "$(pwd)/results:/results" \
-e OCI_REGISTRY -e OCI_TLS -e OCI_REPO1 -e OCI_REPO2 -e OCI_USERNAME -e OCI_PASSWORD -e OCI_VERSION \
conformance:latest
```

Additional environment variables can be specified as needed, or the `oci-conformance.yaml` file can be passed as a volume, mounted at `/oci-conformance.yaml` inside the container.

### GitHub Actions

TODO

## Results

A summary of the test is output to the screen along with any logging.
The results directory (`results` by default) is populated with the following files:

- `report.html`: Full report of the test, including censored output of each request and response.
- `junit.xml`: JUnit report.
Loading