simon d24b0cb5c3 Add goTool autotest with bench configs and UART scenarios.
JSON configs describe network and node MACs; scenarios run command
sequences with expect checks. Share UART client API across CLI and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:36:28 +02:00

48 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# goTool autotest fixtures
## Bench config (`configs/*.json`)
Describes your hardware bench (for documentation and slave lookup in tests).
| Field | Meaning |
|-------|---------|
| `id` | Config name; referenced by scenarios |
| `network` | ESP-NOW network **18** (must match DIP/IO expander on all nodes) |
| `master_mac` | Expected WiFi MAC of the master ESP (reference) |
| `slaves[].id` | Short name used in scenario `input.slave` / `expect.slave` |
| `slaves[].mac` | Full slave STA MAC (must match `gotool clients`) |
| `slaves[].client_id` | Optional; default = last MAC byte |
Copy `example-lab.json` to e.g. `my-lab.json` and set real MACs.
## Scenario (`scenarios/*.json`)
Ordered steps: UART commands with `input` and `expect`.
| Step field | Meaning |
|------------|---------|
| `delay_ms` | Sleep only (no command) |
| `command` | `version`, `clients`, `deadzone`, `unicast_test` |
| `input` | Command arguments (see below) |
| `expect` | Assertions on the response |
### Commands
**version**`expect`: `version`, `version_min`, `git_hash`
**clients**`expect`: `min_clients`, `max_clients`, `client_count`, `slave` / `slaves`, `available`
**deadzone**`input`: `write`, `value`/`deadzone`, `slave` or `client`/`client_id`, `all_clients`
`expect`: `deadzone`, `success`, `slaves_updated`, `slaves_updated_min`
**unicast_test**`input`: `slave` or `client_id`, `seq`
`expect`: `success`, `seq`
### Example
```bash
cd goTool
go run . -port /dev/ttyUSB0 test -config my-lab -scenario smoke
go run . -port /dev/ttyUSB0 test -list-configs
```