]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add test command rsync check
authorBastian Dehn <hhaalo@arcor.de>
Mon, 3 Aug 2026 15:50:30 +0000 (17:50 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 3 Aug 2026 15:50:30 +0000 (17:50 +0200)
src/backup
tests/backup_tests.bats

index 9469b5a2165aaaeee509af09cd34b20a14a8f2fd..ca33079a2fba7a193dec903d2498426ac0892fba 100755 (executable)
@@ -19,6 +19,9 @@ main()
        command -v jq > /dev/null \
                || errlog "command jq not found" \
                || return $?
+       command -v rsync > /dev/null \
+               || errlog "command rsync not found" \
+               || return $?
 }
 
 [ "$TESTMODE" == "ON" ] || return 0
index 31a0863b659ce15994f89a2d875dc35a4d08240a..a2bdccbac26b5c676da8f8f6b1d45f5673d0fdfd 100755 (executable)
@@ -47,3 +47,15 @@ teardown() {
        assert_line --index 0 "⭐ START: backup"
        assert_line --index 1 "❌ ERROR: command jq not found"
 }
+
+@test "failure rsync command not found" {
+       command() {
+               [ "$2" != "rsync" ] || return 1
+       }
+
+       run main
+
+       assert_failure
+       assert_line --index 0 "⭐ START: backup"
+       assert_line --index 1 "❌ ERROR: command rsync not found"
+}