Test for acquisition errors in crowdsec -t (#2629)
This commit is contained in:
parent
23968e472d
commit
0c4093dcca
1 changed files with 13 additions and 0 deletions
|
@ -227,3 +227,16 @@ teardown() {
|
|||
assert_stderr --partial "crowdsec init: while loading acquisition config: no datasource enabled"
|
||||
}
|
||||
|
||||
@test "crowdsec -t (error in acquisition file)" {
|
||||
# we can verify the acquisition configuration without running crowdsec
|
||||
ACQUIS_YAML=$(config_get '.crowdsec_service.acquisition_path')
|
||||
config_set "$ACQUIS_YAML" 'del(.filenames)'
|
||||
|
||||
rune -1 wait-for "${CROWDSEC}"
|
||||
assert_stderr --partial "failed to configure datasource file: no filename or filenames configuration provided"
|
||||
|
||||
config_set "$ACQUIS_YAML" '.filenames=["file.log"]'
|
||||
config_set "$ACQUIS_YAML" '.meh=3'
|
||||
rune -1 wait-for "${CROWDSEC}"
|
||||
assert_stderr --partial "field meh not found in type fileacquisition.FileConfiguration"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue