config-global: don't remove init data; receive community pull (#1644)
This commit is contained in:
parent
920f3d2a7d
commit
607b7d4b6f
|
@ -59,7 +59,14 @@ repositories).
|
||||||
|
|
||||||
- `git submodule init; git submodule update`
|
- `git submodule init; git submodule update`
|
||||||
- `daemonize (linux) or daemon (freebsd), bash, python3, openbsd-netcat`
|
- `daemonize (linux) or daemon (freebsd), bash, python3, openbsd-netcat`
|
||||||
- `yq` from https://github.com/mikefarah/yq
|
- `go install github.com/cloudflare/cfssl/cmd/cfssl@latest`
|
||||||
|
- `go install github.com/cloudflare/cfssl/cmd/cfssljson@latest`
|
||||||
|
- `go install github.com/mikefarah/yq/v4@latest`
|
||||||
|
- `base64`
|
||||||
|
- `curl`
|
||||||
|
- `jq`
|
||||||
|
- `nc`
|
||||||
|
- `python3`
|
||||||
|
|
||||||
## Running all tests
|
## Running all tests
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,12 @@ check_bats_core() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_curl() {
|
||||||
|
if ! command -v curl >/dev/null; then
|
||||||
|
die "missing required program 'curl'"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_python3() {
|
check_python3() {
|
||||||
if ! command -v python3 >/dev/null; then
|
if ! command -v python3 >/dev/null; then
|
||||||
die "missing required program 'python3'"
|
die "missing required program 'python3'"
|
||||||
|
@ -97,6 +103,7 @@ check_gocovmerge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_bats_core
|
check_bats_core
|
||||||
|
check_curl
|
||||||
check_daemonizer
|
check_daemonizer
|
||||||
check_cfssl
|
check_cfssl
|
||||||
check_cfssljson
|
check_cfssljson
|
||||||
|
|
|
@ -57,8 +57,16 @@ make_init_data() {
|
||||||
[[ "${DB_BACKEND}" == "sqlite" ]] || ${CSCLI} machines add --auto
|
[[ "${DB_BACKEND}" == "sqlite" ]] || ${CSCLI} machines add --auto
|
||||||
|
|
||||||
"${TEST_DIR}/instance-crowdsec" start
|
"${TEST_DIR}/instance-crowdsec" start
|
||||||
"${CSCLI}" lapi status
|
|
||||||
[[ -z "${PACKAGE_TESTING}" ]] && "${CSCLI}" decisions delete --all
|
"${CSCLI}" decisions delete --all
|
||||||
|
|
||||||
|
loop_max=15
|
||||||
|
for ((i = 0; i <= loop_max; i++)); do
|
||||||
|
sleep 2
|
||||||
|
[[ $("${CSCLI}" alerts list -o json) != "null" ]] && break
|
||||||
|
done
|
||||||
|
[[ $("${CSCLI}" alerts list -o json) != "null" ]] || die "could not get community data"
|
||||||
|
|
||||||
"${TEST_DIR}/instance-crowdsec" stop
|
"${TEST_DIR}/instance-crowdsec" stop
|
||||||
|
|
||||||
mkdir -p "${LOCAL_INIT_DIR}"
|
mkdir -p "${LOCAL_INIT_DIR}"
|
||||||
|
@ -75,7 +83,6 @@ make_init_data() {
|
||||||
--file "${LOCAL_INIT_DIR}/init-config-data.tar" "${REL_CONFIG_DIR}" "${REL_DATA_DIR}"
|
--file "${LOCAL_INIT_DIR}/init-config-data.tar" "${REL_CONFIG_DIR}" "${REL_DATA_DIR}"
|
||||||
|
|
||||||
./instance-db setup
|
./instance-db setup
|
||||||
remove_init_data
|
|
||||||
}
|
}
|
||||||
|
|
||||||
load_init_data() {
|
load_init_data() {
|
||||||
|
|
Loading…
Reference in a new issue