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>
48 lines
1.6 KiB
Markdown
48 lines
1.6 KiB
Markdown
# 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 **1–8** (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
|
||
```
|