crowdsec/test/bin/generate-hub-tests

20 lines
569 B
Plaintext
Raw Permalink Normal View History

2022-07-21 11:03:46 +00:00
#!/usr/bin/env bash
set -eu
# shellcheck disable=SC1007
2022-10-04 13:58:10 +00:00
THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
# shellcheck disable=SC1091
. "${THIS_DIR}/../.environment.sh"
"${TEST_DIR}/instance-data" load
hubdir="${LOCAL_DIR}/hub-tests"
git clone --depth 1 https://github.com/crowdsecurity/hub.git "${hubdir}" >/dev/null 2>&1 || (cd "${hubdir}"; git pull)
echo "Generating hub tests..."
python3 "$THIS_DIR/generate-hub-tests.py" \
<("${CSCLI}" --crowdsec "${CROWDSEC}" --cscli "${CSCLI}" hubtest --hub "${hubdir}" list -o json) \
"${TEST_DIR}/dyn-bats/"