From 0d841ee98e8aa68d4c9725cd2c8ff5b1061329a3 Mon Sep 17 00:00:00 2001 From: Tobias Kaupat Date: Sun, 18 Oct 2026 10:36:11 +0200 Subject: [PATCH] test: make the failed-backup snapshot assertion target the repo the run used Fail the backup via a nonexistent source on the initialised default repo instead of a nonexistent repository, so snapshot_count can actually go red. Co-Authored-By: Claude Sonnet 5.5 --- test/compat.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/compat.sh b/test/compat.sh index a70ee4a..5de7076 100644 --- a/test/compat.sh +++ b/test/compat.sh @@ -218,9 +218,9 @@ echo "=== compat: failure handling ===" start_container failure wait_for_start || { fail "container starts for failure test"; summary "compat"; exit 1; } write_file /data/hello.txt "backup me" -# Point the run at a repository that does not exist. Deleting files inside the -# repository is not enough, restic happily recreates its directory structure. -fail_log="$(in_container_env RESTIC_REPOSITORY=/mnt/does-not-exist /bin/backup 2>&1)" +# Back up a source that does not exist. The repository stays the initialised +# default one, so the snapshot count below looks at the repo the run really used. +fail_log="$(in_container_env BACKUP_SOURCES=/does-not-exist /bin/backup 2>&1)" assert_contains "$fail_log" "Backup Failed with Status" \ "a failing backup is reported as failed" if in_container test -f /var/log/backup-error-last.log; then