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

1.6 KiB
Raw Blame History

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

versionexpect: version, version_min, git_hash

clientsexpect: min_clients, max_clients, client_count, slave / slaves, available

deadzoneinput: write, value/deadzone, slave or client/client_id, all_clients
expect: deadzone, success, slaves_updated, slaves_updated_min

unicast_testinput: slave or client_id, seq
expect: success, seq

Example

cd goTool
go run . -port /dev/ttyUSB0 test -config my-lab -scenario smoke
go run . -port /dev/ttyUSB0 test -list-configs