feat: deploy cloud-only RMM and verify audited APT diagnostics
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Cloud-only existing UI contracts; never starts a server, agent or fixture."""
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
import cloud_mvp_acceptance as cloud
|
||||
|
||||
CASES=('service_setup','service_start','service_stop','apt_native_install','apt_native_update','ensure_package','apply_updates')
|
||||
|
||||
|
||||
def run(file,prepare=False):
|
||||
value=cloud.contract.protected_json(file)
|
||||
cloud.require(value.get('profile')=='dev/test' and value.get('case') in CASES and
|
||||
value.get('expected_principal')=='simulated-testprincipal-a','fixed cloud root cases only')
|
||||
if prepare:
|
||||
cloud.require(value.get('phase')=='prepare' and value['request']['parameters']['execution_identity']=='root','root preparation only')
|
||||
cloud.prepare_browser()
|
||||
env={k:v for k,v in os.environ.items() if k not in ('DEBUG','PWDEBUG','NODE_DEBUG')}
|
||||
env.update(RMM_E2E_PROFILE='dev/test',RMM_E2E_MODE='mvp-prepare' if prepare else 'mvp-actions',
|
||||
RMM_E2E_CASE_FILE=str(Path(file).resolve()),RMM_E2E_LOGIN_FILE=str(cloud.ROOT/'credentials/server-browser-login.json'),TZ='UTC')
|
||||
result=subprocess.run(['node',str(cloud.ROOT/'web/node_modules/@playwright/test/cli.js'),'test',
|
||||
'--config',str(cloud.ROOT/'deploy/browser/cloud-root.config.ts')],cwd=cloud.ROOT,env=env,
|
||||
capture_output=True,timeout=150)
|
||||
# The dedicated reporter emits only generic statuses. Never publish raw
|
||||
# browser failures, request headers, page state or entered credentials.
|
||||
if result.returncode!=0:
|
||||
lines=re.findall(rb'Cloud/root UI failure source_line=(\d+)',result.stdout)
|
||||
raise cloud.contract.GuardError('cloud_root_UI_incomplete_no_automatic_repeat; source_lines='+','.join(x.decode('ascii') for x in lines))
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--case-file',required=True)
|
||||
parser.add_argument('--prepare-only',action='store_true');args=parser.parse_args()
|
||||
try:run(args.case_file,args.prepare_only)
|
||||
except Exception:
|
||||
print('CLOUD_ROOT_UI_INCOMPLETE; no automatic repeat');raise SystemExit(2) from None
|
||||
Reference in New Issue
Block a user