Files
restic-backup-docker/test
Tobias KaupatandClaude Opus 5 0aced54891 test: prove restic check actually fails on a corrupted repository
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
2026-10-17 23:30:57 +02:00
..