feat: qualify bound configure-only recovery runtime on cloud VM
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -180,14 +180,15 @@ def enable():
|
||||
print('APT-only expiring limits installed; no job or approval created')
|
||||
|
||||
|
||||
def accept(case):
|
||||
def accept(case, *, request=None, folder_root=STATE):
|
||||
m = cloud.contract; target = prior.identity(); backend = cloud.Backend()
|
||||
require(prior.evidence('gate')['unresolved'] == 0, 'unresolved central job; no new attempt')
|
||||
device = backend.call('inventory.get_device', {k:target[k] for k in ('tenant_id','asset_id')})
|
||||
require(device['presence'] == 'online', 'online cloud VM required')
|
||||
planning = adapters.planning_from_device(device)
|
||||
source_case = 'apt_native_install' if case == 'apt_install_retry' else case
|
||||
request = m.case_input(source_case, target, planning=planning)
|
||||
if request is None:
|
||||
planning = adapters.planning_from_device(device)
|
||||
source_case = 'apt_native_install' if case == 'apt_install_retry' else case
|
||||
request = m.case_input(source_case, target, planning=planning)
|
||||
if case == 'apt_install_retry':
|
||||
old = m.protected_json(cloud.ROOT/'devstate/cloud-root/cases/apt_native_install/checkpoint.json')
|
||||
require(old['result']['state'] == 'failed' and old['result']['result']['error_code'] == 'HOOK_NOT_HANDED_OFF', 'original definitive pre-hook failure')
|
||||
@@ -197,7 +198,7 @@ def accept(case):
|
||||
bootstrap_marker_sha256='ec84aa4df8065f0b54b282bd273a6f342f07a6d47312289608389d05c7fb6053'))
|
||||
request['reason'] = 'One new UI-approved fixture attempt: preserve original failed attempt, verify known no-handoff history, separate retry tombstone; never reboot'
|
||||
require({'rmm.sync.v1','helper.root.v1','root:'+request['action'],request['action']} <= set(device['capabilities']), 'native root capability required')
|
||||
folder = STATE/case; folder.mkdir(mode=0o700, exist_ok=False)
|
||||
folder = folder_root/case; folder.mkdir(mode=0o700, exist_ok=False)
|
||||
common = dict(profile='dev/test', case=case, expected_principal='simulated-testprincipal-a', **target)
|
||||
prepare = folder/'prepare.json'; output = folder/'prepared.json'
|
||||
m.write_private(prepare, dict(common, phase='prepare', request=request, output_file=str(output)))
|
||||
@@ -216,11 +217,11 @@ def accept(case):
|
||||
m.write_private(folder/'checkpoint.json', checkpoint)
|
||||
approval = folder/'approve.json'; m.write_private(approval, dict(checkpoint, phase='approve'))
|
||||
print(case+': pending 0/0/0 verified; separate actual UI approval', flush=True); browser(approval)
|
||||
finish(case)
|
||||
finish(case,folder_root=folder_root)
|
||||
|
||||
|
||||
def finish(case):
|
||||
m = cloud.contract; folder = STATE/case; checkpoint = m.protected_json(folder/'checkpoint.json')
|
||||
def finish(case, *, folder_root=STATE):
|
||||
m = cloud.contract; folder = folder_root/case; checkpoint = m.protected_json(folder/'checkpoint.json')
|
||||
job = checkpoint['plan']['jobs'][0]; backend = cloud.Backend(); end = time.monotonic()+420
|
||||
while True:
|
||||
result = backend.call('jobs.get', dict(tenant_id=checkpoint['tenant_id'], job_id=job['job_id']))
|
||||
@@ -239,7 +240,12 @@ def finish(case):
|
||||
package = manifest['resolved_apt_transaction']['packages'][0]
|
||||
require(apt['packages'] == [dict(name='rmm-mvp-test', architecture='all', version=package['new_version'])] and
|
||||
apt['fixture_payload_sha256'] == hashlib.sha256((package['new_version']+'\n').encode()).hexdigest(), 'native version/payload proof')
|
||||
if case in ('apt_install_retry','apt_native_update'):
|
||||
if case=='apt_configure_recovery':
|
||||
require(apt.get('native_recovery') is True and apt.get('partial_proof_sha256')==manifest['native_recovery']['partial_proof_sha256'] and
|
||||
len(apt.get('recovery_record_sha256',''))==64 and 'native_record_sha256' not in apt and
|
||||
apt['test_result_id']==manifest['test_result_id'] and apt['noProductionEvidence'] is True,
|
||||
'separate configure-only recovery record; never fresh installation acceptance')
|
||||
elif case in ('apt_install_retry','apt_native_update'):
|
||||
require(apt['test_acceptance'] is True and apt['noProductionEvidence'] is True and apt['test_result_id'] == manifest['test_result_id'] and
|
||||
len(apt['native_record_sha256']) == 64, 'real scoped native acceptance required')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user