Выполнить лабораторную 5: асинхронный pipeline и исследование идемпотентности

This commit is contained in:
wpyatzy
2026-11-20 18:47:23 +03:00
parent 276dbdad8a
commit ec277e7e64
72 changed files with 6521 additions and 27 deletions
+15
View File
@@ -0,0 +1,15 @@
"""Check that the persistence hook actually restarted every running service."""
import json
from pathlib import Path
root=Path(__file__).resolve().parents[1]/'evidence'
before={c['name']:c for c in json.loads((root/'persistence-before.json').read_text()) if c['status']=='running'}
after={c['name']:c for c in json.loads((root/'persistence-after.json').read_text())}
rows=[]
for name,old in before.items():
new=after[name]
assert old['id']==new['id'],name+': container unexpectedly replaced'
assert old['started_at']!=new['started_at'],name+': process not restarted'
assert old['volumes']==new['volumes'],name+': volumes changed'
assert new['status']=='running',name+': not running'
rows.append(dict(name=name,service=new['service'],same_container=True,process_restarted=True,same_volumes=True))
print(json.dumps({'status':'PASS','running_processes_restarted':len(rows),'rows':rows},indent=2))