adjust test timing for slow boxes (#1681)
This commit is contained in:
parent
e13867f7c9
commit
804b6f4c5d
|
@ -31,12 +31,14 @@ declare stderr
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "crowdsec should not run without LAPI (-no-api flag)" {
|
@test "crowdsec should not run without LAPI (-no-api flag)" {
|
||||||
run -1 --separate-stderr timeout 2s "${CROWDSEC}" -no-api
|
# really needs 4 secs on slow boxes
|
||||||
|
run -1 --separate-stderr timeout 4s "${CROWDSEC}" -no-api
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "crowdsec should not run without LAPI (no api.server in configuration file)" {
|
@test "crowdsec should not run without LAPI (no api.server in configuration file)" {
|
||||||
config_disable_lapi
|
config_disable_lapi
|
||||||
run -1 --separate-stderr timeout 2s "${CROWDSEC}"
|
# really needs 4 secs on slow boxes
|
||||||
|
run -1 --separate-stderr timeout 4s "${CROWDSEC}"
|
||||||
|
|
||||||
run -0 echo "${stderr}"
|
run -0 echo "${stderr}"
|
||||||
assert_output --partial "crowdsec local API is disabled"
|
assert_output --partial "crowdsec local API is disabled"
|
||||||
|
|
|
@ -129,7 +129,7 @@ teardown() {
|
||||||
|
|
||||||
./instance-crowdsec start
|
./instance-crowdsec start
|
||||||
fake_log >>"${tmpfile}"
|
fake_log >>"${tmpfile}"
|
||||||
sleep 1
|
sleep 2
|
||||||
rm -f -- "${tmpfile}"
|
rm -f -- "${tmpfile}"
|
||||||
run -0 --separate-stderr cscli decisions list -o json
|
run -0 --separate-stderr cscli decisions list -o json
|
||||||
run -0 jq -c '.[].decisions[0] | [.value,.type]' <(output)
|
run -0 jq -c '.[].decisions[0] | [.value,.type]' <(output)
|
||||||
|
|
|
@ -37,7 +37,7 @@ teardown() {
|
||||||
|
|
||||||
./instance-crowdsec start
|
./instance-crowdsec start
|
||||||
fake_log >>"${tmpfile}"
|
fake_log >>"${tmpfile}"
|
||||||
sleep 1
|
sleep 2
|
||||||
rm -f -- "${tmpfile}"
|
rm -f -- "${tmpfile}"
|
||||||
run -0 cscli decisions list -o json
|
run -0 cscli decisions list -o json
|
||||||
run -0 jq -r '.[].decisions[0].value' <(output)
|
run -0 jq -r '.[].decisions[0].value' <(output)
|
||||||
|
|
|
@ -25,9 +25,10 @@ fi
|
||||||
|
|
||||||
port_number=$1
|
port_number=$1
|
||||||
|
|
||||||
|
# 4 seconds may seem long, but the tests must work on embedded, slow arm boxes too
|
||||||
for _ in $(seq 40); do
|
for _ in $(seq 40); do
|
||||||
nc -z localhost "${port_number}" >/dev/null 2>&1 && exit 0
|
nc -z localhost "${port_number}" >/dev/null 2>&1 && exit 0
|
||||||
sleep .03
|
sleep .1
|
||||||
done
|
done
|
||||||
|
|
||||||
# send to &3 if open
|
# send to &3 if open
|
||||||
|
|
Loading…
Reference in a new issue