#!/usr/bin/env python3 """Check source registrations and launcher isolation; no services are started.""" import json,os,re,subprocess,xml.etree.ElementTree as ET from pathlib import Path m=json.loads(Path('integration.json').read_text());seen=set() for package,entries in m['payload'].items(): for path,e in entries.items(): assert path not in seen,path;seen.add(path);p=Path('payload')/package/path if 'link' in e:assert p.is_symlink() and os.readlink(p)==e['link'] else: assert p.read_text()==e['text'] and p.stat().st_mode&0o777==e['mode'],path if e['text'].startswith('#!/bin/sh'):subprocess.run(['/bin/sh','-n',str(p)],check=True) if path.endswith(('.policy','.conf')) and e['text'].lstrip().startswith(('