Add focused tests for FreeBSD VM console parsing
- 主要語言
- Rust
- 星號
- 53
- 分支
- 16
- 平均合併
- 4 小時 22 分鐘
- 30 天內合併 PR
- 46
描述
## Current evidence
`tools/check_freebsd_sys.py` contains a `Console` helper that incrementally reads the QEMU serial stream, appends bytes to a text buffer, searches regular expressions across reads, consumes matched prefixes, reports EOF, and enforces timeouts.
Those behaviors are independent of actually booting FreeBSD, but they are currently exercised only as part of the full VM workflow. Regressions in split serial output or buffer consumption therefore require an expensive QEMU run to detect.
## Scope
- Add focused Python unit tests for `Console.expect` without launching QEMU or requiring a FreeBSD image.
- Cover a match contained in one read and a match split across multiple reads.
- Verify matched text is consumed while later buffered output remains available to the next `expect` call.
- Cover EOF before a match, timeout behavior, and guest-log writes.
- Keep the production VM boot and shutdown flow unchanged.
## Completion criteria
- Tests run on a normal development/CI host with only the Python standard library.
- No QEMU, firmware, disk image, network, or compiler invocation is required by the focused tests.
- Existing FreeBSD system-test behavior remains unchanged.
貢獻指南
研究方向
Start with tools/check_freebsd_sys.py and trace Console.expect, including its buffering, EOF, timeout, and guest-log behavior. Add focused standard-library unit tests for single-read and split-read matches, consumption with later buffered output, EOF, timeouts, and log writes; done means they run without QEMU or FreeBSD assets while the existing VM flow remains unchanged.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- operating-systems, testing-qa
- Issue 類型
- 功能
- 難度
- 2/5
- 預估耗時
- 半天
- 活躍度
- 活躍
- 描述清晰度
- 描述清楚
- 新手友好度
- 84/100