rsyncargs+=("$hostpath")
rsyncargs+=("$full_backup_path")
- rsync "${rsyncargs[@]}"
+ rsync "${rsyncargs[@]}" \
+ || errlog "could not backup $machine with path $path" \
+ || return $?
}
machine_backup_pathes()
assert_equal "$(awk 'NR==9 {print; exit}' "$RSYNC_LOG")" "--rsh=\"ssh -p 22\""
assert_equal "$(awk 'NR==10 {print; exit}' "$RSYNC_LOG")" "/home/local"
assert_equal "$(awk 'NR==11 {print; exit}' "$RSYNC_LOG")" "build/2000-01-01_01_backup/onlylocal"
+}
+
+@test "failure backup machine path rsync failed" {
+ rsync() {
+ return 1
+ }
+ run main
+
+ assert_failure
+ assert_line --index 0 "⭐ START: backup"
+ assert_line --partial "❌ ERROR: could not backup testpc1 with path /etc"
}
\ No newline at end of file