Add runtime capability scaffolding and align docs
This commit is contained in:
parent
fb8b985049
commit
cbf212bb7b
19 changed files with 1048 additions and 71 deletions
|
|
@ -40,6 +40,10 @@ def test_run_demo_happy_path(monkeypatch: pytest.MonkeyPatch) -> None:
|
|||
calls.append(("start_vm", {"vm_id": vm_id}))
|
||||
return {"vm_id": vm_id}
|
||||
|
||||
def status_vm(self, vm_id: str) -> dict[str, Any]:
|
||||
calls.append(("status_vm", {"vm_id": vm_id}))
|
||||
return {"vm_id": vm_id, "network_enabled": False, "execution_mode": "host_compat"}
|
||||
|
||||
def exec_vm(self, vm_id: str, *, command: str, timeout_seconds: int) -> dict[str, Any]:
|
||||
calls.append(
|
||||
(
|
||||
|
|
@ -55,7 +59,13 @@ def test_run_demo_happy_path(monkeypatch: pytest.MonkeyPatch) -> None:
|
|||
assert result["exit_code"] == 0
|
||||
assert calls[0][0] == "create_vm"
|
||||
assert calls[1] == ("start_vm", {"vm_id": "vm-1"})
|
||||
assert calls[2][0] == "exec_vm"
|
||||
assert calls[2] == ("status_vm", {"vm_id": "vm-1"})
|
||||
assert calls[3][0] == "exec_vm"
|
||||
|
||||
|
||||
def test_demo_command_prefers_network_probe_for_guest_vsock() -> None:
|
||||
status = {"network_enabled": True, "execution_mode": "guest_vsock"}
|
||||
assert "https://example.com" in demo_module._demo_command(status)
|
||||
|
||||
|
||||
def test_main_prints_json(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue