Finish the 3.1.0 secondary disk-tools milestone so stable workspaces can be stopped, inspected offline, exported as raw ext4 images, and started again without changing the primary workspace-first interaction model. Add workspace stop/start plus workspace disk export/list/read across the CLI, SDK, and MCP, backed by a new offline debugfs inspection helper and guest-only validation. Scrub runtime-only guest state before disk inspection/export, and fix the real guest reliability gaps by flushing the filesystem on stop and removing stale Firecracker socket files before restart. Update the docs, examples, changelog, and roadmap to mark 3.1.0 done, and cover the new lifecycle/disk paths with API, CLI, manager, contract, and package-surface tests. Validation: uv lock; UV_CACHE_DIR=.uv-cache make check; UV_CACHE_DIR=.uv-cache make dist-check; real guest-backed smoke for create, shell/service activity, stop, workspace disk list/read/export, start, exec, and delete.
34 lines
963 B
Python
34 lines
963 B
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
|
|
import pytest
|
|
|
|
import pyro_mcp.doctor as doctor_module
|
|
from pyro_mcp.runtime import DEFAULT_PLATFORM
|
|
|
|
|
|
def test_doctor_main_prints_json(
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
capsys: pytest.CaptureFixture[str],
|
|
) -> None:
|
|
class StubParser:
|
|
def parse_args(self) -> argparse.Namespace:
|
|
return argparse.Namespace(platform="linux-x86_64")
|
|
|
|
monkeypatch.setattr(doctor_module, "_build_parser", lambda: StubParser())
|
|
monkeypatch.setattr(
|
|
doctor_module,
|
|
"doctor_report",
|
|
lambda platform: {"platform": platform, "runtime_ok": True, "issues": []},
|
|
)
|
|
doctor_module.main()
|
|
output = json.loads(capsys.readouterr().out)
|
|
assert output["runtime_ok"] is True
|
|
|
|
|
|
def test_doctor_build_parser_defaults_platform() -> None:
|
|
parser = doctor_module._build_parser()
|
|
args = parser.parse_args([])
|
|
assert args.platform == DEFAULT_PLATFORM
|