]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add command check savelog
authorBastian Dehn <hhaalo@arcor.de>
Sun, 9 Aug 2026 10:32:29 +0000 (12:32 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 9 Aug 2026 10:32:29 +0000 (12:32 +0200)
src/backup
tests/backup_tests.bats

index 24daa6faf605720e9fd6c3ee3877b45c2406566a..b4ce4e60b487d9bc636be60a4311782519afa666 100755 (executable)
@@ -68,6 +68,9 @@ exists_needed_commands()
        command -v ssh > /dev/null \
                || errlog "command ssh not found" \
                || return $?
+       command -v savelog > /dev/null \
+               || errlog "command savelog not found" \
+               || return $?
 }
 
 exists_config_file()
index 71ad2978deec528f0de8b48e451fa9787d5ce2af..3c3ccfcef1693c76b3a6923fb59aed1833e4afb9 100755 (executable)
@@ -91,6 +91,19 @@ teardown() {
        assert_line --index 1 "❌ ERROR: command ssh not found"
 }
 
+# bats test_tags=backup:start,backup:savelog
+@test "failure savelog command not found" {
+       command() {
+               [ "$2" != "savelog" ] || return 1
+       }
+
+       run main
+
+       assert_failure
+       assert_line --index 0 "⭐ START: backup"
+       assert_line --index 1 "❌ ERROR: command savelog not found"
+}
+
 # bats test_tags=backup:start,backup:config
 @test "failure config.yaml not found" {
        exists_config_file() {