-
-
Notifications
You must be signed in to change notification settings - Fork 261
Protocol conformance test suite #620
Copy link
Copy link
Closed
Milestone
Description
Summary
Create a dedicated test suite that validates the library's protocol implementation against the S7 protocol specification, covering packet structure, error codes, and edge cases.
Background
The current tests validate functionality (read/write works, server responds correctly) but don't systematically verify protocol-level correctness. A conformance suite would test that every PDU is correctly formed according to the protocol specification.
What needs to be done
- Collect reference packet captures from known-good implementations (Wireshark captures from real PLCs)
- Create test cases that verify PDU encoding matches expected byte sequences
- Create test cases that verify PDU decoding handles all valid packet variations
- Test all S7 error codes are correctly parsed and mapped
- Test TPKT framing edge cases (fragmentation, maximum sizes)
- Test COTP connection establishment variations
- Test PDU size negotiation boundary conditions
- Test malformed packet handling (fuzzing-style tests for robustness)
- Verify multi-packet (fragmented) transfer assembly
- Add as a separate pytest marker (e.g.,
pytest -m conformance)
Notes
- Wireshark's S7 dissector is a good reference for expected packet formats
- Could use captured pcap files as test fixtures
- This would also help validate S7CommPlus protocol implementation as it develops
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels