diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a622b..0c7d87b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* test: bkctld check-incs shouldn't fail without incs_policy file + ### Changed ### Deprecated diff --git a/test/checks.bats b/test/checks.bats index f8e5c85..65a2ccc 100644 --- a/test/checks.bats +++ b/test/checks.bats @@ -235,4 +235,18 @@ OUT run /usr/lib/bkctld/bkctld-check-incs assert_equal "0" "$status" } + +@test "Check-incs doesn't fail without incs_policy file" { + # Delete all possible incs polixy files + rm -f /etc/evobackup/${JAILNAME} + rm -rf /etc/evobackup/${JAILNAME}.d/incs_policy + + # Run bkctld-check-incs and store stderr in a file + local stderrPath="${BATS_TMPDIR}/${BATS_TEST_NAME}.stderr" + /usr/lib/bkctld/bkctld-check-incs 2> ${stderrPath} + + # Verify if + run grep -E "^stat:" ${stderrPath} + assert_failure +} # TODO: write many more tests for bkctld-check-incs