mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-22 10:42:30 +01:00
add test for reportemail = no
This commit is contained in:
parent
51cd07781a
commit
21ff09e2ec
@ -3,6 +3,7 @@ load common
|
||||
teardown_backupninja() {
|
||||
[ -x /usr/bin/mail.moved ] && mv /usr/bin/mail.moved /usr/bin/mail
|
||||
[ -x /usr/bin/rsync.moved ] && mv /usr/bin/rsync.moved /usr/bin/rsync
|
||||
rm -f /var/mail/vagrant
|
||||
}
|
||||
|
||||
create_test_action() {
|
||||
@ -235,6 +236,16 @@ create_test_action() {
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "reports: email not sent when reportemail is no" {
|
||||
create_test_action info test_info
|
||||
setconfig backupninja.conf reportsuccess yes
|
||||
setconfig backupninja.conf reportinfo yes
|
||||
setconfig backupninja.conf reportemail no
|
||||
run backupninja --now -f "${BATS_TMPDIR}/backupninja.conf" --run "${BATS_TMPDIR}/backup.d/test.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
! test -f /var/mail/vagrant
|
||||
}
|
||||
|
||||
@test "scheduling: runs when = 'everyday at 01' and time matches" {
|
||||
create_test_action info test_info
|
||||
setconfig backupninja.conf when 'everyday at 01'
|
||||
|
Loading…
Reference in New Issue
Block a user