Skip to content

Commit

Permalink
fix package tests for 1.5.6-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Dec 9, 2023
1 parent 0c02949 commit 88a16e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/bats/01_crowdsec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ teardown() {
ACQUIS_YAML=$(config_get '.crowdsec_service.acquisition_path')
config_set "$ACQUIS_YAML" 'del(.filenames)'

# if filenames are missing, it won't be able to detect source type
config_set "$ACQUIS_YAML" '.source="file"'
rune -1 wait-for "${CROWDSEC}"
assert_stderr --partial "failed to configure datasource file: no filename or filenames configuration provided"

Expand Down
8 changes: 8 additions & 0 deletions test/lib/config/config-global
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ remove_init_data() {

# we need a separate function for initializing config when testing package
# because we want to test the configuration as well
config_prepare() {
# remove trailing slash from CONFIG_DIR
# since it's assumed to be missing during the tests
yq e -i '
.config_paths.config_dir |= sub("/$", "")
' "${CONFIG_DIR}/config.yaml"
}

make_init_data() {
./bin/assert-crowdsec-not-running || die "Cannot create fixture data."

config_prepare
./instance-db config-yaml
./instance-db setup

Expand Down

0 comments on commit 88a16e6

Please sign in to comment.