test(golden): add WHO=2 automation fixtures and privacy validation suite (#304) - #46
Conversation
…ite (#304)
- Add WHO=2 cover status and command fixtures for leading-zero ('01') and two-digit ('11') addresses from physical plant capture in OpenWebNet-HA/MyHOME#304
- Synchronize tests/golden/corpus.json via validate_corpus.py (82 total fixtures)
- Update tests/golden/SOURCE.yaml with privacy-safe community capture provenance
- Add privacy first validation in tools/golden/validate_corpus.py ensuring no LAN IPs or sensitive data leak
- Add tests/test_golden_privacy.py asserting zero private LAN IPs, non-synthetic MACs, or user paths in test tree
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fedem95
left a comment
There was a problem hiding this comment.
Address 11 is fine: up, down, stop and status all appear in marcob79's log. Address 01 does not. His trace only contains *#2*01## and *2*0*01## — *2*1*01## and *2*2*01## are nowhere in it. They are correct frames, but they were inferred, and they carry source: community-plant-capture while SOURCE.yaml promises "authentic on-wire bus frames ... captured from live physical hardware".
Either relabel those two (the 93-address equivalents already live under public-readme), or ask @marcob79 to run that shutter once and capture them. His log also has *#2*02## and *2*0*02## if you want more real leading-zero coverage.
Everything else checks out: all 8 frames parse and round-trip, builder parity holds (raise_shutter("01") → *2*1*01##), no duplicates with the existing corpus, full suite green locally (658 passed) and CI is 8/8.
Three small things in the privacy suite:
IPV4is compiled but never used in test_golden_privacy.py.- the MAC check covers the frame files and corpus.json but not SOURCE.yaml, which is where a real MAC would most plausibly end up.
- stray blank line at the end of who02_automation.yaml.
Summary
Follows up on real-world testing from @marcob79 in OpenWebNet-HA/MyHOME#304 on a dual-MH201 setup controlling WHO=2 covers/automation.
This PR adds authentic on-wire golden sample test vectors for WHO=2 automation to OWNd's Golden Corpus and establishes an automated Privacy-First test suite, mirroring the privacy standard in MyHOME.
Changes
1. WHO=2 Automation Golden Fixtures (
tests/golden/frames/who02_automation.yaml)Added 8 new test vectors covering:
01):*#2*01##(status request)*2*1*01##(shutter UP)*2*2*01##(shutter DOWN)*2*0*01##(shutter STOP)11):*#2*11##(status request)*2*1*11##(shutter UP)*2*2*11##(shutter DOWN)*2*0*11##(shutter STOP)openwebnet-mcp, verifies bidirectional roundtrip (OWNMessage.parse), and asserts exact builder parity (OWNAutomationCommand).2. Runtime Corpus Synchronization (
tests/golden/corpus.json)tools/golden/validate_corpus.py(total corpus expanded from 74 to 82 valid fixtures).3. Privacy-First Validation (
tests/test_golden_privacy.py&tools/golden/validate_corpus.py)10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) can ever be committed to the golden corpus or test fixtures.00:03:50:00:)./home/,C:\Users\) leak into test definitions.tools/golden/validate_corpus.pyso any privacy violation immediately halts validation.4. Manifest Provenance (
tests/golden/SOURCE.yaml)community_captureprovenance for BTicino MH201 + WHO=2 Automation referencing MH201: unexpected error logs with unclear reason MyHOME#304 with fully anonymized metadata.