load helpers_zot function verify_prerequisites { if [ ! $(command -v curl) ]; then echo "you need to install curl as a prerequisite to running the tests" >&3 return 1 fi if [ ! $(command -v jq) ]; then echo "you need to install jq as a prerequisite to running the tests" >&3 return 1 fi if [ ! $(command -v htpasswd) ]; then echo "you need to install htpasswd 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 zot_htpasswd_file=${BATS_FILE_TMPDIR}/zot_htpasswd htpasswd -Bbn test test123 >> ${zot_htpasswd_file} echo ${zot_root_dir} >&3 mkdir -p ${zot_root_dir} cat > ${zot_config_file}<