Finalize guest boot and exec runtime updates
This commit is contained in:
parent
23a2dfb330
commit
1b19bff7b6
7 changed files with 198 additions and 8 deletions
21
tests/test_runtime_boot_check.py
Normal file
21
tests/test_runtime_boot_check.py
Normal 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
|
||||
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue