fix(chv-muse-r12fix-2): P6 worker 接进镜像(build.sh + BUILDINFO + lockfile)
R12 真机:chv-gitea-worker / chv-sync-worker-client / privsep.py / safety.py / chv-gitea-worker.service 5 文件全不在 镜像内,build.sh 从未有 P6 拷入行,全链路无法跑。按 gap 文档 §2 接入说明落地:worker 三件硬校验 + 拷入 /usr/local/bin/ 与 /etc/systemd/system/(mv 去后缀 + chmod +x + systemctl enable);privsep/safety 叶子模块条件拷入 /usr/local/lib/chv-gitea/(与 P3 同款口径,缺失只警告); 叶子树 __init__ 用 stub(绝不拷真实 cloud/chv/__init__.py, round-11 层 1 教训),stub 需 errors.py 故一并拷入;runcmd 在 chv-sync boot 前加 systemctl start chv-gitea-worker。 BUILDINFO contents 列入 worker 三件(无条件)与 privsep/ safety(条件,extra_contents);两处 lockfile 登记补齐 P6 五项,另补 P4 三件自 P4 起缺失的登记。
This commit is contained in:
1 parent
b923d0291b
commit
33ca6c75ed
7 files changed
+125
-5
No files matched your search
@@ -756,5 +756,39 @@ class ExecutorAuditHookTest(unittest.TestCase):
|
||||
safety_mod.DEFAULT_AUDIT_LOGGER = old
|
||||
|
||||
|
||||
class BuildInfoContentsTest(unittest.TestCase):
|
||||
"""round-12 修复轮(项 2,P6):worker 三件须进 BUILDINFO
|
||||
contents(无条件拷入,与 P2/P4 同款钉法)。"""
|
||||
|
||||
def test_contents_include_p6_items(self):
|
||||
root = Path(__file__).resolve().parents[2]
|
||||
path = root / "chv-guest" / "buildinfo.py"
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"chv_guest_p6_buildinfo", str(path))
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
out = os.path.join(tmp, "out")
|
||||
os.makedirs(out)
|
||||
for name, content in (("disk.raw", b"D"),
|
||||
("vmlinux", b"K")):
|
||||
with open(os.path.join(out, name), "wb") as fh:
|
||||
fh.write(content)
|
||||
for name, lines in (
|
||||
("guest-versions-dpkg.txt", ["git 9.9.9-9ubuntu9"]),
|
||||
("guest-versions-pip.txt", ["playwright==9.9.9"]),
|
||||
("guest-versions-gt.txt", ["gt version 1.0.0"]),
|
||||
("guest-versions-chromium.txt",
|
||||
["chromium_headless_shell-1248"])):
|
||||
with open(os.path.join(out, name), "w") as fh:
|
||||
fh.write("\n".join(lines) + "\n")
|
||||
info = module.build(
|
||||
out, "chv-guest-24.04-0.164.0-alpha.9-abc1234", "24.04",
|
||||
"0.164.0-alpha.9", "abc1234", "0" * 64, True, "1248")
|
||||
for item in ("chv-gitea-worker", "chv-sync-worker-client",
|
||||
"chv-gitea-worker.service"):
|
||||
self.assertIn(item, info["contents"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user