diff --git a/Makefile b/Makefile index c76d314e..a99c4de2 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ HELM := $(TOOLSDIR)/bin/helm ORAS := $(TOOLSDIR)/bin/oras ORAS_VERSION := 1.0.0-rc.1 REGCLIENT := $(TOOLSDIR)/bin/regctl -REGCLIENT_VERSION := v0.4.5 +REGCLIENT_VERSION := v0.5.7 CRICTL := $(TOOLSDIR)/bin/crictl CRICTL_VERSION := v1.26.1 ACTION_VALIDATOR := $(TOOLSDIR)/bin/action-validator diff --git a/test/blackbox/ci.sh b/test/blackbox/ci.sh index 0859b69c..14974440 100755 --- a/test/blackbox/ci.sh +++ b/test/blackbox/ci.sh @@ -8,8 +8,8 @@ BATS=${SCRIPTPATH}/../../hack/tools/bin/bats PATH=$PATH:${SCRIPTPATH}/../../hack/tools/bin tests=("pushpull" "pushpull_authn" "delete_images" "referrers" "metadata" "anonymous_policy" - "annotations" "detect_manifest_collision" "cve" "sync" "sync_docker" "sync_replica_cluster" - "scrub" "garbage_collect" "metrics" "metrics_minimal") + "annotations" "detect_manifest_collision" "cve" "sync" "sync_docker" "sync_replica_cluster" + "scrub" "garbage_collect" "metrics" "metrics_minimal" "multiarch_index") for test in ${tests[*]}; do ${BATS} ${BATS_FLAGS} ${SCRIPTPATH}/${test}.bats > ${test}.log & pids+=($!) diff --git a/test/blackbox/multiarch_index.bats b/test/blackbox/multiarch_index.bats new file mode 100644 index 00000000..477e46a5 --- /dev/null +++ b/test/blackbox/multiarch_index.bats @@ -0,0 +1,109 @@ +# Note: Intended to be run as "make run-blackbox-tests" or "make run-blackbox-ci" +# Makefile target installs & checks all necessary tooling +# Extra tools that are not covered in Makefile target needs to be added in verify_prerequisites() + +load helpers_zot + +function verify_prerequisites { + if [ ! $(command -v regctl) ]; then + echo "you need to install regctl as a prerequisite to running the tests" >&3 + return 1 + fi + + return 0 +} + +function setup_file() { + # Verify prerequisites are available + if ! $(verify_prerequisites); then + exit 1 + fi + # Setup zot server + local zot_root_dir=${BATS_FILE_TMPDIR}/zot + local zot_config_file=${BATS_FILE_TMPDIR}/zot_config.json + local oci_data_dir=${BATS_FILE_TMPDIR}/oci + mkdir -p ${zot_root_dir} + mkdir -p ${oci_data_dir} + zot_port=$(get_free_port) + echo ${zot_port} > ${BATS_FILE_TMPDIR}/zot.port + cat > ${zot_config_file}<