refactor: keep root install as the sole installer source

This commit is contained in:
Antigravity committed 2026-10-05 03:36:25 +00:00
1 parent 6491a766f4
commit a46bd6e132
14 files changed
+95 -385

No files matched your search

+11 -4
View File
@@ -13,6 +13,8 @@ import tempfile
import unittest
from unittest import mock
from install_support import load_installer
ROOT = Path(__file__).resolve().parents[2]
@@ -24,7 +26,7 @@ def load_module(name, path):
return module
installer = load_module("dever_installer", ROOT / "skills/scripts/install.py")
installer = load_installer()
assets = load_module("dever_release_assets", ROOT / "sdk/release-assets.py")
@@ -343,10 +345,9 @@ class InstallerTests(unittest.TestCase):
installer.prerequisites("linux-x86_64")
@unittest.skipUnless(installer.os.geteuid() == 0, "owned image installation requires root")
def test_standalone_bash_uses_embedded_key_and_cleans_after_signature_failure(self):
def test_standalone_bash_requires_trusted_key_and_cleans_after_signature_failure(self):
# Execute an independently signed fixture to observe the entire entry
# and bootstrap call chain, without installing a machine or service.
generator = load_module("dever_install_entry", ROOT / "sdk/install-entry.py")
launcher = self.release / "bootstrap/dever"
launcher.write_text('''#!/usr/bin/python3
import json
@@ -364,10 +365,16 @@ assert setting["activate_service"] is False
artifact.update(bytes=len(content), sha256=hashlib.sha256(content).hexdigest())
(self.release / "manifest.json").write_text(json.dumps(manifest))
self.sign_manifest()
entry = generator.render((ROOT / "skills/scripts/install.py").read_text(), self.public.read_text())
entry = (ROOT / "install").read_text()
image = self.directory("image")
arguments = ["/bin/bash", "-s", "--", "--release", str(self.release),
"--system-root", str(image), "--version", "1.2.3", "--no-start"]
untrusted = subprocess.run(arguments, input=entry, env={}, text=True,
capture_output=True, timeout=20)
self.assertNotEqual(untrusted.returncode, 0)
self.assertIn("签名校验失败", untrusted.stderr)
self.assertEqual(list(image.iterdir()), [])
arguments.extend(["--trusted-key", str(self.public)])
completed = subprocess.run(arguments, input=entry, env={}, text=True,
capture_output=True, timeout=20)
self.assertEqual(completed.returncode, 0, completed.stderr)