Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
Created March 31, 2021 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdolitsky/2c85fe4d26ac32bb1bf09b58cf164a52 to your computer and use it in GitHub Desktop.
Save jdolitsky/2c85fe4d26ac32bb1bf09b58cf164a52 to your computer and use it in GitHub Desktop.
zot-oci-conformance.sh
#!/usr/bin/env bash
set -e
#
# zot-oci-conformance.sh
#
# Run OCI Distirbution Spec conformance tests (v1.0.0-rc2)
# against Zot registry server: https://github.com/anuvu/zot
#
# Start Zot server at localhost:5000
TAG="1.1.13"
DIGEST="sha256:4e5d09b185bc7f12633f3b5e70bb23bf915e6896a1be242f37b3ac96b6d5ccf6"
docker rm -f registry || true
echo '{
"http": {"address": "0.0.0.0", "port": 5000},
"storage": {"gc": false, "dedupe": false, "rootDirectory": "/var/lib/registry"}
}' > ./zot.json
docker run -p 5000:5000 -d --restart always --name registry \
-v "${PWD}/zot.json":/etc/zot/config.json \
-v "${PWD}/registry":/var/lib/registry \
"docker.io/atomixos/zot:${TAG}@${DIGEST}"
# Run distribution-spec conformance tests
TAG="v1.0.0-rc2"
DIGEST="sha256:2f0ced454ce31793cc69d48a05233ea76f2ebe791936d053342b66388a6de260"
docker run --net host --rm -w /out -v "${PWD}":/out \
-e OCI_ROOT_URL="http://localhost:5000" \
-e OCI_NAMESPACE="oci-test-1" \
-e OCI_CROSSMOUNT_NAMESPACE="oci-test-2" \
-e OCI_TEST_PULL=1 \
-e OCI_TEST_PUSH=1 \
-e OCI_TEST_CONTENT_DISCOVERY=1 \
-e OCI_TEST_CONTENT_MANAGEMENT=1 \
"ghcr.io/opencontainers/distribution-spec/conformance:${TAG}@${DIGEST}"
# Check out the HTML report
open ./report.html
@jdolitsky
Copy link
Author

Download verify and run:

curl -LO https://gist.githubusercontent.com/jdolitsky/2c85fe4d26ac32bb1bf09b58cf164a52/raw/0b2df11cbdaab57be546b1514a326c2387637646/zot-oci-conformance.sh
shasum -a 256 ./zot-oci-conformance.sh | grep '^150bbf57b6b0080231373ed971e6308f19164d479a4f20e1d5d4360c9f947f81  '
chmod +x ./zot-oci-conformance.sh
./zot-oci-conformance.sh

@jdolitsky
Copy link
Author

Results:

Screen Shot 2021-03-31 at 3 09 09 PM

Ran 59 of 62 Specs in 0.486 seconds
SUCCESS! -- 59 Passed | 0 Failed | 0 Pending | 3 Skipped
PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment