Files
cc-ci/tests/custom-html-rst-bad/ops.py
autonomic-bot 9449b22f24
Some checks failed
continuous-integration/drone/push Build is failing
fix(regression): separate recipe for bad-restore (custom-html-rst-bad)
Having test_backup.py in custom-html-bkp-bad caused both bad-backup and bad-restore
to fail at the backup tier. Create custom-html-rst-bad with its own cc-ci test dir
that has ops.py+test_restore.py but NO test_backup.py, so:
- backup: only generic test_backup_artifact → PASS (snapshot exists)
- restore: pre_restore writes 'mutated', marker stays 'mutated' after restore → FAIL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 02:15:03 +00:00

16 lines
512 B
Python

"""custom-html-rst-bad — lifecycle ops for bad-restore RED canary.
NO pre_backup hook: marker never seeded before backup → snapshot has no ci-marker.txt.
pre_restore writes "mutated". After restore, marker stays "mutated" (not in snapshot) → FAIL.
"""
from __future__ import annotations
from harness import lifecycle
MARKER_PATH = "/usr/share/nginx/html/ci-marker.txt"
def pre_restore(domain: str, meta: dict) -> None:
lifecycle.exec_in_app(domain, ["sh", "-c", f"echo mutated > {MARKER_PATH}"])