test(s7): live python-snap7 coverage for the #632/#638 codecs, TSAP override and PDU size (#632)
Extends the s7_1500 profile (DB1 2048 bytes, 'hex' seed type) with distinct non-zero seeds for STRING/WSTRING/CHAR/WCHAR/DTL/DATE/TOD/TIME/S5TIME plus undecodable buffers; S7_1500CodecTests covers reads, BadOutOfRange paths, write round-trips (S7_SIM_ALLOW_WRITES=1), TSAP keys and negotiated PDU size. Skips when S7_SIM_ENDPOINT is unreachable. Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
@@ -93,7 +93,7 @@ known offsets:
|
||||
| `MW0` | u16 | `1` | `S7ProbeOptions.ProbeAddress` default |
|
||||
|
||||
Seed types supported: `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `f32`,
|
||||
`bool` (with `"bit": 0..7`), `ascii` (S7 STRING).
|
||||
`bool` (with `"bit": 0..7`), `ascii` (S7 STRING), `hex` (raw bytes).
|
||||
|
||||
### Span-planner gate seeds (offsets 300+, `S7_1500SpanReadTests`)
|
||||
|
||||
@@ -119,6 +119,32 @@ inside the holes cluster A's span reads through. No tag maps to them; they are
|
||||
there so a mis-computed slice offset returns garbage instead of a zero that could
|
||||
match by luck. Every seed above is distinct and non-zero for the same reason.
|
||||
|
||||
### Codec gate seeds (offsets 800+, `S7_1500CodecTests`, #632/#638)
|
||||
|
||||
DB1 is 2048 bytes. Seeds use the `hex` seed type (raw big-endian bytes) for WSTRING/DTL/undecodable
|
||||
headers. All distinct and non-zero. Writes go to the **unseeded** 1100..1199 scratch area
|
||||
(`S7_SIM_ALLOW_WRITES=1` required).
|
||||
|
||||
| Address | Type | Seed | Decodes to |
|
||||
|---|---|---|---|
|
||||
| `DB1.DBB800` | STRING max 32 | `Siemens S7` | `"Siemens S7"` |
|
||||
| `DB1.DBB840` | WSTRING max 8 | `0008 0005 0047 0072 00fc 00df 0065` | `"Grüße"` |
|
||||
| `DB1.DBB870` | CHAR | `0x51` | `"Q"` |
|
||||
| `DB1.DBB872` | WCHAR | `0x20AC` | `"€"` |
|
||||
| `DB1.DBB880` | DTL | `07e8 03 0f 06 0d 2d 38 2f075f4c` | 2024-03-15 13:45:56.7890123 |
|
||||
| `DB1.DBW900` | DATE | `11488` | 2021-06-15 |
|
||||
| `DB1.DBD904` | TOD | `49556789` | 49 556 789 ms (13:45:56.789) |
|
||||
| `DB1.DBD910` / `914` | TIME | `123456789` / `-86400123` | same, ms |
|
||||
| `DB1.DBW920` / `922` | S5TIME | `0x2789` / `0x0123` | 789 000 ms / 1 230 ms |
|
||||
| `DB1.DBW960` | DATE | `0xFFFF` | 2169-06-06 |
|
||||
| `DB1.DBB930` | DTL | all zero (unseeded) | BadOutOfRange (uninitialised) |
|
||||
| `DB1.DBW940` | S5TIME | `0x0A5F` | BadOutOfRange (non-BCD nibble) |
|
||||
| `DB1.DBD944` | TOD | `0xFFFFFFFF` | BadOutOfRange (past midnight) |
|
||||
| `DB1.DBB950` | WSTRING max 3 | `0003 0009` | BadOutOfRange (cur > max) |
|
||||
|
||||
snap7 does not validate STRING/WSTRING headers or TSAPs, so the TSAP-override theory proves the keys
|
||||
reach the wire and the connection still works — not TSAP semantics (hardware only).
|
||||
|
||||
### Timer / Counter (TM / CT) areas
|
||||
|
||||
`TM0` and `CT0` are 64 bytes each — **32 device cells**, since a timer is a 2-byte
|
||||
|
||||
Reference in New Issue
Block a user