fix(chv): 阶段 3 live 根因——浏览器 socket 与数据盘 profile 的两处权限

- /run/chv 0755 root:root 时 chv-browser 建 browser.sock 报
  PermissionError、服务无限 crash-loop(P2 遗留,阶段 2 从未验
  过 browser.sock):tmpfiles 改 0775 root:chv-browser。
- /home/chv 默认 0750,chv-browser 穿不过家目录,ismount 判假、
  profile 静默回落本机盘:chv-data-mount 挂载成功后 chmod 0751
  /home/chv(只放行穿过,不放行列表)。
- 驱动:等 cloud-init done + 四服务 active 再验浏览器。
- 回归 97 项全过(新增 2 项接线断言)。
This commit is contained in:
host committed 2026-11-08 09:45:00 +00:00
1 parent 1188e4b000
commit eb495892e1
3 files changed
+28 -1

No files matched your search

+14
View File
@@ -352,6 +352,20 @@ class BuildWiringTest(unittest.TestCase):
self.assertIn("After=network.target cloud-final.service",
block)
def test_tmpfiles_lets_browser_bind_its_socket(self):
# 阶段 3 live 根因:/run/chv 0755 root:root 时 chv-browser
# 建 browser.sock 报 PermissionError、服务无限 crash-loop。
text = (ROOT / "chv-guest" / "build.sh").read_text()
self.assertIn("d /run/chv 0775 root chv-browser -", text)
self.assertNotIn("d /run/chv 0755 root root -", text)
def test_data_mount_lets_browser_traverse_home(self):
# 阶段 3 live 根因 #2:/home/chv 默认 0750,chv-browser
# 穿不过家目录,ismount 判假、profile 静默回落本机盘。
text = (ROOT / "chv-guest" / "chv-data-mount.sh").read_text()
self.assertIn("chmod 0751 /home/chv", text)
self.assertIn(".chv-browser-profile", text)
def test_dry_run_contains_stage3_browser_wiring(self):
with tempfile.TemporaryDirectory() as tmp:
repo = os.path.join(tmp, "repo")