0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-30 22:34:13 -05:00

test: add more registries in sync blackbox tests (#1568)

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu 2023-06-30 21:07:04 +03:00 committed by GitHub
parent 7ec748f58a
commit 6932e3ffca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,6 +98,42 @@ function setup_file() {
], ],
"onDemand": true, "onDemand": true,
"tlsVerify": true "tlsVerify": true
},
{
"urls": [
"https://registry.gitlab.com"
],
"content": [
{
"prefix": "gitlab-org/public-image-archive/gitlab-ee"
}
],
"onDemand": true,
"tlsVerify": true
},
{
"urls": [
"https://quay.io"
],
"content": [
{
"prefix": "coreos/etcd"
}
],
"onDemand": true,
"tlsVerify": true
},
{
"urls": [
"https://ghcr.io"
],
"content": [
{
"prefix": "project-zot/zot-linux-amd64"
}
],
"onDemand": true,
"tlsVerify": true
} }
] ]
} }
@ -239,6 +275,42 @@ function teardown_file() {
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ] [ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
} }
@test "sync image on demand from registry.gitlab.com" {
run skopeo copy docker://127.0.0.1:8090/gitlab-org/public-image-archive/gitlab-ee:15.11.6-ee.0 oci:${TEST_DATA_DIR} --src-tls-verify=false
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "gitlab-org/public-image-archive/gitlab-ee"))' | jq '.[]') = '"gitlab-org/public-image-archive/gitlab-ee"' ]
run curl http://127.0.0.1:8090/v2/gitlab-org/public-image-archive/gitlab-ee/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"15.11.6-ee.0"' ]
}
@test "sync image on demand from quay.io" {
run skopeo copy docker://127.0.0.1:8090/coreos/etcd:v3.4.26 oci:${TEST_DATA_DIR} --src-tls-verify=false
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "coreos/etcd"))' | jq '.[]') = '"coreos/etcd"' ]
run curl http://127.0.0.1:8090/v2/coreos/etcd/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"v3.4.26"' ]
}
@test "sync image on demand from ghcr.io" {
run skopeo copy docker://127.0.0.1:8090/project-zot/zot-linux-amd64:v2.0.0-rc5 oci:${TEST_DATA_DIR} --src-tls-verify=false
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "project-zot/zot-linux-amd64"))' | jq '.[]') = '"project-zot/zot-linux-amd64"' ]
run curl http://127.0.0.1:8090/v2/project-zot/zot-linux-amd64/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"v2.0.0-rc5"' ]
}
@test "run docker with image synced from docker.io/library" { @test "run docker with image synced from docker.io/library" {
local zot_root_dir=${BATS_FILE_TMPDIR}/zot local zot_root_dir=${BATS_FILE_TMPDIR}/zot
run rm -rf ${zot_root_dir} run rm -rf ${zot_root_dir}
@ -312,3 +384,39 @@ function teardown_file() {
run docker kill $(docker ps -q) run docker kill $(docker ps -q)
} }
@test "run docker with image synced from registry.gitlab.com" {
run docker run -d 127.0.0.1:8090/gitlab-org/public-image-archive/gitlab-ee:15.11.6-ee.0
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "gitlab-org/public-image-archive/gitlab-ee"))' | jq '.[]') = '"gitlab-org/public-image-archive/gitlab-ee"' ]
run curl http://127.0.0.1:8090/v2/gitlab-org/public-image-archive/gitlab-ee/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"15.11.6-ee.0"' ]
}
@test "run docker with image synced from quay.io" {
run docker run -d 127.0.0.1:8090/coreos/etcd:v3.4.26
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "coreos/etcd"))' | jq '.[]') = '"coreos/etcd"' ]
run curl http://127.0.0.1:8090/v2/coreos/etcd/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"v3.4.26"' ]
}
@test "run docker with image synced from ghcr.io" {
run docker run -d 127.0.0.1:8090/project-zot/zot-linux-amd64:v2.0.0-rc5
[ "$status" -eq 0 ]
run curl http://127.0.0.1:8090/v2/_catalog
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}"| jq '.repositories | map(select(. == "project-zot/zot-linux-amd64"))' | jq '.[]') = '"project-zot/zot-linux-amd64"' ]
run curl http://127.0.0.1:8090/v2/project-zot/zot-linux-amd64/tags/list
[ "$status" -eq 0 ]
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"v2.0.0-rc5"' ]
}