YNX-1104/1105: Add integration test framework and pairing failure path tests
- YNX-1104a: Create Server-Client integration test framework - MockTransportPair for simulating network communication - createIntegrationTestContext() for test environment setup - First-time pairing flow integration tests - Reconnection flow tests - YNX-1105a: Create failure path test matrix documentation - MATRIX.md with PF/AF/RP/CF/HF/SR categories - Priority marking for critical security paths - YNX-1105b: Implement pairing failure path tests - PF-01: Invalid pairing code with retry - PF-02: Expired pairing code cleanup - PF-03: Unknown identifier rejection - PF-04: Admin notification failure handling - PF-05: Empty/whitespace code rejection - PF-06: Malformed payload handling - PF-07: Double pairing protection - Edge cases: concurrent pairing, state cleanup - Update TASKLIST.md with completion status
This commit is contained in:
62
TASKLIST.md
62
TASKLIST.md
@@ -1051,10 +1051,47 @@
|
||||
- 已覆盖启动时加载 state + 自动补 keypair、`hello_ack`/`pair_request`/`pair_success`/`auth_success` 协作链路、`auth_failed`/`re_pair_required` 的 trust reset,以及认证后 heartbeat 发送门禁
|
||||
|
||||
### YNX-1104 编写 Server-Client 集成测试
|
||||
**状态**
|
||||
- [x] 框架已完成(2026-04-09)
|
||||
|
||||
**目标**
|
||||
- 覆盖首次配对、正常重连、认证失败、心跳超时、re-pair
|
||||
|
||||
**已完成内容**
|
||||
- 已创建 `tests/integration/framework.test.ts` 集成测试框架
|
||||
- 提供 `MockTransportPair` 模拟 Server-Client 网络通信
|
||||
- 提供 `createIntegrationTestContext()` 快速创建集成测试环境
|
||||
- 实现首批集成测试用例:
|
||||
- 首次配对完整流程(hello → pair_request → pair_confirm → auth → heartbeat)
|
||||
- 带凭证的重连流程(跳过配对直接认证)
|
||||
- 心跳交换验证
|
||||
|
||||
**待完成**
|
||||
- 更多边界场景:心跳超时断线、re-pair 触发、并发连接
|
||||
- 真实 WebSocket 传输层集成测试(可选)
|
||||
|
||||
---
|
||||
### YNX-1104a 细化:首次配对集成测试
|
||||
**状态**
|
||||
- [x] 已完成(2026-04-09)
|
||||
|
||||
**已完成内容**
|
||||
- `First-Time Pairing Flow` 测试套件
|
||||
- 验证端到端的配对与认证状态迁移
|
||||
|
||||
---
|
||||
### YNX-1104b 细化:重连集成测试
|
||||
**状态**
|
||||
- [x] 已完成(2026-04-09)
|
||||
|
||||
**已完成内容**
|
||||
- `Reconnection Flow` 测试套件
|
||||
- 验证已配对客户端跳过配对直接进入认证
|
||||
|
||||
### YNX-1105 编写失败路径测试矩阵
|
||||
**状态**
|
||||
- [x] 框架与 PF 测试已完成(2026-04-09)
|
||||
|
||||
**目标**
|
||||
- 系统性覆盖 pairing/auth 失败路径
|
||||
|
||||
@@ -1072,6 +1109,31 @@
|
||||
**验收标准**
|
||||
- 核心安全路径都有自动化测试
|
||||
|
||||
**已完成内容**
|
||||
- 已创建 `tests/failure-path/MATRIX.md` 失败路径测试矩阵文档
|
||||
- 定义 PF-01~PF-10(Pairing Failures)
|
||||
- 定义 AF-01~AF-11(Authentication Failures)
|
||||
- 定义 RP-01~RP-04(Re-pairing Triggers)
|
||||
- 定义 CF-01~CF-07(Connection Failures)
|
||||
- 定义 HF-01~HF-04(Heartbeat Failures)
|
||||
- 定义 SR-01~SR-06(State Recovery)
|
||||
- 标记优先级(🔴 Phase 1 关键安全路径)
|
||||
|
||||
- 已创建 `tests/failure-path/pairing-failures.test.ts`
|
||||
- PF-01: 无效配对码及重试机制
|
||||
- PF-02: 过期配对码清理
|
||||
- PF-03: 非 allowlist 标识符拒绝
|
||||
- PF-04: 管理员通知失败处理
|
||||
- PF-05: 空/空白配对码拒绝
|
||||
- PF-06: 畸形 pair_confirm 载荷处理
|
||||
- PF-07: 已配对客户端重复配对保护
|
||||
- Edge Cases: 并发配对、过期清理验证
|
||||
|
||||
**待完成**
|
||||
- AF(Authentication Failures)测试套件
|
||||
- RP(Re-pairing Triggers)测试套件
|
||||
- CF/HF/SR 边界场景测试
|
||||
|
||||
---
|
||||
|
||||
## Phase 12 — 文档与交付
|
||||
|
||||
Reference in New Issue
Block a user