Commit f0257a2
authored
test(e2e): add verbose logging verification for CLI commands (#323)
Adds comprehensive E2E test coverage verifying that emulator verbose logging correctly captures Modbus operations during CLI read/write commands.
## E2E Test Coverage (4 new tests)
- Read single data point with verbose logging
- Read multiple data points with verbose logging
- Write operation with verbose logging
- Write with verification (logs both WRITE and READ)
Each test verifies:
- Correct operation type ([VERBOSE] READ or [VERBOSE] WRITE)
- Slave ID, function code, register address, count
- Specific hex values for data being read/written
## Documentation Improvements
- Inline comments explain hex value conversions (e.g., 2300 = 0x08FC = 230.0V)
- Register address explanations (e.g., 0x002B = device_address config parameter)
- Driver behavior notes (e.g., "EX9EM reads all 11 registers in one operation")
- Comments explain why specific function codes are used (0x03 vs 0x10)
## Test Infrastructure
Enhanced helpers.bash with:
- Verbose flag support for emulator startup
- Improved log file handling (temp log + symlink approach)
- New assert_emulator_log_contains helper for log verification
- Comprehensive cleanup of all temporary artifacts
## Technical Details
Tests verify VerboseLogger output format:
[VERBOSE] {READ|WRITE} slave={id} func=0x{code} addr=0x{addr} count={n} values=[0x{val1}, ...]
Known limitation: Discover command verbose logging test omitted due to emulator restart issue (tracked for follow-up).
Builds on PR #322.1 parent ae931a0 commit f0257a2
2 files changed
Lines changed: 228 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
87 | 118 | | |
88 | 119 | | |
89 | | - | |
| 120 | + | |
90 | 121 | | |
91 | 122 | | |
92 | 123 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
97 | 143 | | |
98 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
99 | 152 | | |
| 153 | + | |
100 | 154 | | |
101 | 155 | | |
102 | 156 | | |
| |||
107 | 161 | | |
108 | 162 | | |
109 | 163 | | |
110 | | - | |
| 164 | + | |
111 | 165 | | |
112 | 166 | | |
113 | 167 | | |
114 | 168 | | |
115 | | - | |
| 169 | + | |
116 | 170 | | |
117 | 171 | | |
118 | 172 | | |
| |||
122 | 176 | | |
123 | 177 | | |
124 | 178 | | |
125 | | - | |
126 | 179 | | |
127 | 180 | | |
128 | 181 | | |
129 | 182 | | |
130 | 183 | | |
131 | 184 | | |
132 | 185 | | |
133 | | - | |
| 186 | + | |
134 | 187 | | |
135 | 188 | | |
136 | 189 | | |
| |||
139 | 192 | | |
140 | 193 | | |
141 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
142 | 202 | | |
143 | 203 | | |
144 | 204 | | |
| 205 | + | |
145 | 206 | | |
146 | 207 | | |
147 | 208 | | |
| |||
181 | 242 | | |
182 | 243 | | |
183 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
184 | 256 | | |
| 257 | + | |
185 | 258 | | |
186 | 259 | | |
187 | 260 | | |
| |||
238 | 311 | | |
239 | 312 | | |
240 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
241 | 356 | | |
242 | 357 | | |
243 | 358 | | |
| |||
249 | 364 | | |
250 | 365 | | |
251 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
252 | 370 | | |
253 | 371 | | |
0 commit comments