2022-07-21 11:03:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-03-09 13:45:36 +00:00
|
|
|
|
|
|
|
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"
|
2022-03-09 13:45:36 +00:00
|
|
|
|
|
|
|
"${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..."
|
|
|
|
|
2023-12-15 17:30:20 +00:00
|
|
|
python3 "$THIS_DIR/generate-hub-tests.py" \
|
|
|
|
<("${CSCLI}" --crowdsec "${CROWDSEC}" --cscli "${CSCLI}" hubtest --hub "${hubdir}" list -o json) \
|
|
|
|
"${TEST_DIR}/dyn-bats/"
|