test: accept bounded cloud logs and equal UI HTTP MCP evidence
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
|
||||
def inspect_helpers(payload):
|
||||
import sqlite3
|
||||
program=r'''import json,os,socket,struct,uuid
|
||||
program=r'''import json,os,socket,struct,uuid,sys
|
||||
from pathlib import Path
|
||||
result={}
|
||||
for kind,pin_path,socket_path in (
|
||||
('general','/etc/rmm-remote/general-helper-proof.json','/run/rmm-helper-cloud/control.sock'),
|
||||
('apt','/etc/rmm-remote/apt-helper-proof.json','/run/rmm-apt-helper/helper.sock')):
|
||||
if kind=='apt' and sys.argv[1]=='general':continue
|
||||
pin_path=Path(pin_path);socket_path=Path(socket_path)
|
||||
for path in list(pin_path.parents)+[pin_path]+list(socket_path.parents):
|
||||
meta=path.lstat();assert not path.is_symlink() and meta.st_uid==0 and meta.st_mode&0o022==0
|
||||
@@ -30,10 +31,10 @@ for kind,pin_path,socket_path in (
|
||||
assert response['schema_version']==1 and response['challenge']==challenge and response['identity']==pin['identity'] and response['profile']==pin['profile']
|
||||
assert response[field]==pin[field] and response['ledger_inode'] and response['lock_inode']
|
||||
result[kind]=response
|
||||
assert all(result['general'][k]==result['apt'][k] for k in ('ledger_device','ledger_inode','lock_device','lock_inode'))
|
||||
if 'apt' in result:assert all(result['general'][k]==result['apt'][k] for k in ('ledger_device','ledger_inode','lock_device','lock_inode'))
|
||||
print(json.dumps(result))
|
||||
'''
|
||||
process=subprocess.run(['/usr/sbin/runuser','-u','rmm-agent','--','/usr/bin/python3','-I','-c',program],capture_output=True,check=True,timeout=25)
|
||||
process=subprocess.run(['/usr/sbin/runuser','-u','rmm-agent','--','/usr/bin/python3','-I','-c',program,'general' if payload.get('general_only') is True else 'both'],capture_output=True,check=True,timeout=25)
|
||||
result=json.loads(process.stdout)
|
||||
for peer in result.values():
|
||||
require(all(peer['identity'][key]==payload[key] for key in ('tenant_id','asset_id','agent_id')),'helper target identity drift')
|
||||
|
||||
Reference in New Issue
Block a user