github.com/crowdsecurity/crowdsec@v1.6.1/test/bin/generate-hub-tests (about) 1 #!/usr/bin/env bash 2 3 set -eu 4 5 # shellcheck disable=SC1007 6 THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 7 # shellcheck disable=SC1091 8 . "${THIS_DIR}/../.environment.sh" 9 10 "${TEST_DIR}/instance-data" load 11 12 hubdir="${LOCAL_DIR}/hub-tests" 13 git clone --depth 1 https://github.com/crowdsecurity/hub.git "${hubdir}" >/dev/null 2>&1 || (cd "${hubdir}"; git pull) 14 15 echo "Generating hub tests..." 16 17 python3 "$THIS_DIR/generate-hub-tests.py" \ 18 <("${CSCLI}" --crowdsec "${CROWDSEC}" --cscli "${CSCLI}" hubtest --hub "${hubdir}" list -o json) \ 19 "${TEST_DIR}/dyn-bats/"