fix: reconcile configured APT effect without retroactive acceptance and retain host reboot evidence
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -9,7 +9,7 @@ from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
|
||||
from test_guard import apt
|
||||
from test_native_acceptance import context, fixture_transaction, action_manifest, signed_job, prechecks
|
||||
from test_native_acceptance import context, fixture_transaction, action_manifest, signed_job, prechecks, host_before
|
||||
import test_native_retry as retry_fixture
|
||||
|
||||
|
||||
@@ -80,7 +80,9 @@ def recovery_files():
|
||||
for name, data in {'context.json': apt.canonical(new.__dict__), 'signed-action.json': new_job,
|
||||
'expectation.json': apt.canonical(obj), 'baseline.json': apt.canonical(snapshot),
|
||||
'partial-proof.json': apt.canonical(proof), 'apt.conf': apt.apt_config(),
|
||||
'native-prechecks.json': apt.canonical(prechecks(new)),
|
||||
'host-reboot-before.json': apt.canonical(host_before(new)),
|
||||
'native-prechecks.json': apt.canonical(prechecks(new,host_before(new))),
|
||||
'sandbox-result.json': apt.canonical({'transaction_sha256':new.transaction_sha256,'apt_exit_code':0,'reboot_required':False}),
|
||||
'hook-armed.json': b'{}'}.items():
|
||||
(active/name).write_bytes(data)
|
||||
yield base, tx, new, action, proof, previous
|
||||
@@ -114,7 +116,7 @@ class NativeRecoveryTests(TestCase):
|
||||
self.assertEqual(path.name,'recovery-attempt-'+proof['grant_id']+'.json')
|
||||
apt.durable_once(path,binding)
|
||||
with self.assertRaisesRegex(apt.Veto,'ALREADY_HANDED_OFF'): apt.durable_once(path,binding)
|
||||
with patch.object(apt,'runtime_identity',return_value={}):
|
||||
with patch.object(apt,'runtime_identity',return_value={}),patch.object(Path,'read_text',return_value=ctx.boot_id):
|
||||
evidence = apt.complete_acceptance(tx,ctx,action,{}, {'reboot_required':False})
|
||||
self.assertTrue(evidence['native_recovery'])
|
||||
self.assertNotIn('native_record_sha256',evidence)
|
||||
|
||||
Reference in New Issue
Block a user