From 99f0c0d626240d0d3c0ea642062222aa514ec0c4 Mon Sep 17 00:00:00 2001 From: devops Date: Mon, 26 Oct 2026 05:10:41 +0000 Subject: [PATCH] test(ops): fence rollout fixture evidence and systemctl writes --- scripts/tests/test_stage_rollout.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tests/test_stage_rollout.py b/scripts/tests/test_stage_rollout.py index 250b4695..8f57e714 100644 --- a/scripts/tests/test_stage_rollout.py +++ b/scripts/tests/test_stage_rollout.py @@ -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'))