test(ops): fence rollout fixture evidence and systemctl writes
Deploy Canina / deploy (push) Failing after 1s

This commit is contained in:
devops committed 2026-10-26 05:10:41 +00:00
1 parent 1e27387016
commit 99f0c0d626
1 file changed
+5
+5
View File
@@ -94,6 +94,11 @@ class RolloutTests(unittest.TestCase):
(tools/'docker').chmod(0o755)
script = (ROOT/'scripts/deploy.sh').read_text()
script = script.replace('/opt/services/canina/stage-backend-deploy.lock', str(base/'lock')).replace('/opt/services/canina/stage', str(stage)).replace('/opt/services/canina/releases', str(releases)).replace('https://git.parsaaghayi.ir/parsa/canina.git', str(source)).replace('[ -d /opt/services/proxy/certs/canina ]', 'true')
script = script.replace('/opt/services/canina/tmp/retention-stage.json', str(base/'retention-stage.json'))
# Fail closed if any copied installer unexpectedly reaches systemd.
(tools/'systemctl').write_text('#!/bin/sh\nprintf "unexpected systemctl\\n" >&2\nexit 99\n')
(tools/'systemctl').chmod(0o755)
self.assertNotIn('> /opt/services/canina/tmp/retention-stage.json',script, 'Fixture must never write live retention evidence')
deploy = base/'deploy.sh'
deploy.write_text(script)
env = dict(os.environ, GITHUB_ACTIONS='true', DEPLOY_SHA=sha, PATH=str(tools)+':'+os.environ['PATH'], TRACE=str(base/'trace'), FIXTURE=str(base/'config.json'))