Files
STM32F4-Base/test/host/README.md
T

53 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# test/host/ — 主机端测试脚本
> PC 侧的测试驱动与判读脚本(Python,跑在开发机上,经串口/网络与目标板交互)。
## 文件一览
### 流程与判读
| 脚本 | 作用 |
|---|---|
| `run_boot_test.py` | **`@test` 一键闭环**:开串口+清日志 → 烧录 → wait-idle → `verify_log` 校验(退出码 0=PASS) |
| `verify_log.py` | **日志标记校验**:Required / Forbidden 标记 → PASS / FAIL |
| `e02_probe.py` | E-02 专项探针(错误码传播审计) |
### 网络 / FTP
| 脚本 | 作用 |
|---|---|
| `ch395f_socket_test.py` | Socket 通信测试(回显服务器 / 文件收发) |
| `ftp_test.py` | FTP 基本功能测试 |
| `ftp_up_dl_test.py` | FTP 上传下载测试 |
| `ftp_speed_test.py` | FTP 传输速度测试 |
| `ftp_capture.py` | FTP 流量抓取 |
| `ftp_regression.py` | FTP 回归套件 |
### 时间 / 时延
| 脚本 | 作用 |
|---|---|
| `latency_peer.py` | 链路时延测试的 PC 对端(peer) |
| `time_sync_server.py` | 时间同步推送服务(对时源) |
## 运行方式
```bash
# @test 一键闭环(推荐)
& '.venv\Scripts\python.exe' test/host/run_boot_test.py
```
> 串口端口配置在 `.opencode/serial_config.json`(单一配置源,当前 COM6/115200)。
## ⚠️ 注意
- **PYTHONPATH/路径敏感**:脚本按仓库根相对路径读写,**从仓库根执行**
- 本目录**被 pre-commit 门禁排除**
- 台架探针族(TCP 复连 / FTP 中止等)在 `MDK-ARM/*.py`,与本目录分工不同
## 相关文档
- `docs/测试说明/自动化测试流程.md` — `@test` 细节与失败模式
- `docs/测试说明/测试开发标准流程.md` — 测试分层与门禁
- `docs/测试说明/CH395F_Test_Guide.md`、`FTP_Test_Guide.md`