# 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 curl ] &>/dev/null; then echo "you need to install curl as a prerequisite to running the tests" >&3 return 1 fi if [ ! command -v jq ] &>/dev/null; then echo "you need to install jq as a prerequisite to running the tests" >&3 return 1 fi } function setup_file() { # Verify prerequisites are available if ! verify_prerequisites; then exit 1 fi # Download test data to folder common for the entire suite, not just this file skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/test-images/alpine:3.17.3 oci:${TEST_DATA_DIR}/alpine:3.17.3 # Setup zot server ZOT_ROOT_DIR=${BATS_FILE_TMPDIR}/zot echo ${ZOT_ROOT_DIR} local zot_log_file=${BATS_FILE_TMPDIR}/zot-log.json local zot_config_file=${BATS_FILE_TMPDIR}/zot_config.json mkdir -p ${ZOT_ROOT_DIR} touch ${zot_log_file} cat >${zot_config_file} <