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>
This commit is contained in:
@@ -25,9 +25,23 @@ go run . -port /dev/ttyUSB0 clients
|
||||
| `version` | `0x03` | Prints `version` and `git_hash` from firmware |
|
||||
| `clients` | `0x04` | Lists slaves registered on the master via ESP-NOW |
|
||||
| `unicast-test` | `0x07` | Sends ESP-NOW unicast test to one slave (`-client`, `-seq`) |
|
||||
| `test` | — | Run an automated scenario (JSON configs under `testdata/`) |
|
||||
|
||||
`clients` requires slaves to have responded to master discover broadcasts first.
|
||||
|
||||
### Automated tests
|
||||
|
||||
Bench **configs** (`testdata/configs/`) list master/slave MACs. **Scenarios** (`testdata/scenarios/`) run a sequence of the same UART commands with `input` / `expect` checks.
|
||||
|
||||
```bash
|
||||
go run . -port /dev/ttyUSB0 test -list-configs
|
||||
go run . -port /dev/ttyUSB0 test -list-scenarios
|
||||
go run . -port /dev/ttyUSB0 test -config example-lab -scenario smoke
|
||||
go run . -port /dev/ttyUSB0 test -config testdata/configs/my-lab.json -scenario smoke -v
|
||||
```
|
||||
|
||||
See [`testdata/README.md`](testdata/README.md) for the JSON schema.
|
||||
|
||||
```bash
|
||||
go run . -port /dev/ttyUSB0 unicast-test -client 16 -seq 42
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user