Skip to content
Snippets Groups Projects
Verified Commit 21ff09e2 authored by Jérôme Charaoui's avatar Jérôme Charaoui
Browse files

add test for reportemail = no

parent 51cd0778
Branches master
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ load common ...@@ -3,6 +3,7 @@ load common
teardown_backupninja() { teardown_backupninja() {
[ -x /usr/bin/mail.moved ] && mv /usr/bin/mail.moved /usr/bin/mail [ -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 [ -x /usr/bin/rsync.moved ] && mv /usr/bin/rsync.moved /usr/bin/rsync
rm -f /var/mail/vagrant
} }
create_test_action() { create_test_action() {
...@@ -235,6 +236,16 @@ create_test_action() { ...@@ -235,6 +236,16 @@ create_test_action() {
[ "$status" -eq 1 ] [ "$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" { @test "scheduling: runs when = 'everyday at 01' and time matches" {
create_test_action info test_info create_test_action info test_info
setconfig backupninja.conf when 'everyday at 01' setconfig backupninja.conf when 'everyday at 01'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment