test(ha-config-bootstrap): RED-phase tests for ha-term.bin durability (task 6.1)
5 Unity tests covering persist (req 9.1), restore (req 9.2 RED), missing-file zero-init (req 9.3), CRC-mismatch safe-zero, and write+rename atomicity. Build fails with 3 undefined-reference linker errors on ha_restore_term() — expected RED phase proof.
This commit is contained in:
parent
ab174c8b06
commit
722d7824c4
4 changed files with 406 additions and 1 deletions
|
|
@ -135,7 +135,7 @@ Dependency order: startup validation (D) unblocks vtaskmgr before election (A);
|
|||
- _Boundary: Config Bootstrap (config_repl.c, myapp.c)_
|
||||
|
||||
- [ ] 6. Change 9: Election state durability (ha-term.bin)
|
||||
- [ ] 6.1 Write failing tests for ha-term.bin persist and restore
|
||||
- [x] 6.1 Write failing tests for ha-term.bin persist and restore
|
||||
- In `src/controller/testsuite/test_ha_durability.c`: test `ha_persist_term()` writes file; test `ha_init()` restores term and voted_for from file; test CRC mismatch → zeroes state safely with WARN log; test missing file → term=0, no prior vote; test write+rename atomicity (partial write leaves old file intact)
|
||||
- `make test` fails
|
||||
- _Requirements: 9.1, 9.2, 9.3_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue