mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-11-13 23:45:24 +00:00
compat.sh only grepped the check output for "Check Successful". check.sh
prints that string whenever restic exits 0, so a `restic check` that had
been turned into a no-op kept the suite green - the integrity check, half
the purpose of this image, was untested.
Adds a section that backs up, overwrites the first pack file under
/mnt/restic/data with garbage and then requires the failure path:
"Check Failed with Status", no "Check Successful", and
/var/log/check-error-last.log written. It uses its own throwaway container
so the later tests do not inherit the broken repository.
Verification on Git-Bash:
bash test/compat.sh -> 36 passed, 0 failed
sabotage (check.sh: restic check -> true), rebuilt image
IMAGE=rbd-sab-check bash test/compat.sh -> 33 passed, 3 failed, exit 1
- restic check detects a corrupted repository
- a corrupted repository is not reported as successful
- failing check writes check-error-last.log
check.sh was restored with git checkout and the sabotage image removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Agent-Id: agent-4966d0e6-7f4d-4b37-be3d-0648ed56cb8a