mysql test: delays in strem test (#1387)
This commit is contained in:
parent
aef62f74f8
commit
7329a9d4b2
|
@ -37,24 +37,24 @@ api() {
|
|||
|
||||
@test "$FILE stream start" {
|
||||
run -0 api "/v1/decisions/stream?startup=true"
|
||||
[[ "$DB_BACKEND" == "mysql" ]] && sleep 3
|
||||
run -0 jq -r '.new' <(output)
|
||||
assert_output --partial '1111:2222:3333:4444:5555:6666:7777:8888'
|
||||
assert_output --partial '1.2.3.4'
|
||||
assert_output --partial '1.2.4.0/24'
|
||||
|
||||
}
|
||||
|
||||
@test "$FILE stream cont (add)" {
|
||||
sleep 1
|
||||
run -0 cscli decisions add -i '1.2.3.5'
|
||||
[[ "$DB_BACKEND" == "mysql" ]] && sleep 3
|
||||
run -0 api "/v1/decisions/stream"
|
||||
run -0 jq -r '.new' <(output)
|
||||
assert_output --partial '1.2.3.5'
|
||||
}
|
||||
|
||||
@test "$FILE stream cont (del)" {
|
||||
sleep 1
|
||||
run -0 cscli decisions delete -i '1.2.3.4'
|
||||
[[ "$DB_BACKEND" == "mysql" ]] && sleep 3
|
||||
run -0 api "/v1/decisions/stream"
|
||||
run -0 jq -r '.deleted' <(output)
|
||||
assert_output --partial '1.2.3.4'
|
||||
|
|
|
@ -78,7 +78,8 @@ restore() {
|
|||
"--port=${MYSQL_PORT}" \
|
||||
"--password=${MYSQL_PASSWORD}" < "$backup_file"
|
||||
|
||||
exec_sql "CREATE USER IF NOT EXISTS 'crowdsec_test' IDENTIFIED BY 'crowdsec_test';"
|
||||
exec_sql "DROP USER IF EXISTS 'crowdsec_test';"
|
||||
exec_sql "CREATE USER 'crowdsec_test' IDENTIFIED BY 'crowdsec_test';"
|
||||
exec_sql "GRANT ALL PRIVILEGES ON crowdsec_test.* TO 'crowdsec_test';"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue