Finalize guest boot and exec runtime updates

This commit is contained in:
Thales Maciel 2026-03-07 17:09:21 -03:00
parent 23a2dfb330
commit 1b19bff7b6
7 changed files with 198 additions and 8 deletions

View file

@ -0,0 +1,21 @@
from __future__ import annotations
from pyro_mcp.runtime_boot_check import _classify_result
def test_classify_result_reports_kernel_panic() -> None:
reason = _classify_result(
firecracker_log="Successfully started microvm",
serial_log="Kernel panic - not syncing: VFS: Unable to mount root fs",
vm_alive=False,
)
assert reason == "guest kernel panic during boot"
def test_classify_result_reports_success_when_vm_stays_alive() -> None:
reason = _classify_result(
firecracker_log="Successfully started microvm",
serial_log="boot log",
vm_alive=True,
)
assert reason is None

View file

@ -47,6 +47,7 @@ def test_build_launch_plan_writes_expected_files(tmp_path: Path) -> None:
rendered = json.loads(plan.config_path.read_text(encoding="utf-8"))
assert rendered["machine-config"]["vcpu_count"] == 2
assert rendered["network-interfaces"][0]["host_dev_name"] == "pyroabcdef12"
assert "acpi=off" in rendered["boot-source"]["boot_args"]
assert "init=/opt/pyro/bin/pyro-init" in rendered["boot-source"]["boot_args"]
assert "pyro.guest_ip=172.29.100.2" in rendered["boot-source"]["boot_args"]
assert "pyro.gateway_ip=172.29.100.1" in rendered["boot-source"]["boot_args"]