forked from evolix/evobackup
test: bkctld check-incs shouldn't fail without incs_policy file
Currently it does, because we "stat" a blank file (issue #43).
This commit is contained in:
parent
b7cddcac27
commit
a41eb2a218
|
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* test: bkctld check-incs shouldn't fail without incs_policy file
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -235,4 +235,18 @@ OUT
|
||||||
run /usr/lib/bkctld/bkctld-check-incs
|
run /usr/lib/bkctld/bkctld-check-incs
|
||||||
assert_equal "0" "$status"
|
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
|
# TODO: write many more tests for bkctld-check-incs
|
||||||
|
|
Loading…
Reference in a new issue