test: expand failure and recovery coverage

This commit is contained in:
nav
2026-04-09 03:33:09 +00:00
parent 8c9307f061
commit 12224c761f
4 changed files with 17 additions and 9 deletions

View File

@@ -61,8 +61,8 @@ This document defines the systematic test coverage for pairing and authenticatio
| ID | Scenario | Trigger | Expected Behavior | Status |
|----|----------|---------|-------------------|--------|
| CF-01 | Network partition | Connection drops mid-auth | Client retries with backoff | |
| CF-02 | Server unreachable | Initial connect fails | Exponential backoff retry | |
| CF-01 | Network partition | Connection drops mid-auth | Client retries with backoff | |
| CF-02 | Server unreachable | Initial connect fails | Exponential backoff retry | |
| CF-03 | Duplicate connection | Same ID connects twice | Old connection closed, new accepted | ✅ |
| CF-04 | Protocol version mismatch | Unsupported version | Connection rejected with error | ✅ |
| CF-05 | Malformed hello | Invalid payload / missing required hello fields | Error response, connection maintained | ✅ |
@@ -87,7 +87,7 @@ This document defines the systematic test coverage for pairing and authenticatio
| ID | Scenario | Condition | Expected Recovery | Status |
|----|----------|-----------|-------------------|--------|
| SR-01 | Server restart with pending pairing | Pairing in progress | Preserve pairing state, code valid | ✅ |
| SR-02 | Server restart with active sessions | Online clients | All marked offline, reconnect required | |
| SR-02 | Server restart with active sessions | Online clients | All marked offline, reconnect required | |
| SR-03 | Client restart with credentials | Has secret + keys | Resume with auth, no re-pairing | ✅ |
| SR-04 | Client restart without credentials | First run | Full pairing flow required | ✅ |
| SR-05 | Corrupted server store | File unreadable | Surface corruption error clearly for operator handling | ✅ |
@@ -134,7 +134,7 @@ npm test -- failure-paths
- AF-04 (`invalid_secret`) 仍未单独覆盖:现有实现把“错误 secret 导致的验签失败”统一落到 `invalid_signature`,是否拆分错误码仍待确认。
- RP-04key rotation当前仍视为 v2+ 议题v1 尚未承诺“无重配对换 key”语义因此暂不强行补测试。
- 本轮已补齐 AF-01/02/03/05/06/09/10/11、RP-01/02、CF-03/04/05/07、HF-01/02、PF-09、SR-01/03/04/05/06。
- 本轮已补齐 AF-01/02/03/05/06/09/10/11、RP-01/02、CF-01/02/03/04/05/07、HF-01/02、PF-09、SR-01/02/03/04/05/06。
### Adding New Test Cases