Add audit maintenance, verified recovery and reproducible verification
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0e6f1-443f-7783-9920-a16b2ffc467f
This commit is contained in:
parent
820f0ff7b5
commit
3166da1d2e
13 changed files with 413 additions and 5 deletions
|
|
@ -9,6 +9,7 @@ import unittest
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts'))
|
||||
from alert_ack import Actor, Store
|
||||
from alert_admin import snapshot
|
||||
|
||||
|
||||
@unittest.skipUnless(os.environ.get('RTEL_AUDIT_CORE_SOURCE'), 'set RTEL_AUDIT_CORE_SOURCE for real receiver check')
|
||||
|
|
@ -42,7 +43,9 @@ class NativeAuditTests(unittest.TestCase):
|
|||
raise TimeoutError('simulated lost response')
|
||||
return response['status'], json.loads(body)
|
||||
store.drain(send)
|
||||
store = Store(Path(tmp) / 'ack.db')
|
||||
snapshot(store.path, Path(tmp) / 'backup.db')
|
||||
snapshot(Path(tmp) / 'backup.db', Path(tmp) / 'restored.db')
|
||||
store = Store(Path(tmp) / 'restored.db')
|
||||
store.drain(send)
|
||||
self.assertEqual(calls, [202, 200])
|
||||
self.assertEqual(store.get(identity)['audit_status'], 'delivered')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue