Extend autotest to cover all UART commands except OTA upload.
Add led_ring, find_me, restart, and ota_progress steps plus uart_cmds scenario. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
+20
-1
@@ -44,6 +44,19 @@ Ordered steps: UART commands, delays, or esptool reset.
|
||||
**unicast_test** — `input`: `slave` or `client_id`, `seq`
|
||||
`expect`: `success`, `seq`
|
||||
|
||||
**led_ring** — `input`: `mode` (`clear`, `progress`, `digit`, `blink`, `find_me`), `progress`, `digit`, `r`/`g`/`b`, `intensity`, `blink_ms`, `blink_count`
|
||||
`expect`: `success`, `mode`, `progress`, `digit`
|
||||
|
||||
**find_me** — `input`: `client` / `client_id` or `slave` (`0` = master ring)
|
||||
`expect`: `success`
|
||||
|
||||
**restart** — `input`: `client` / `client_id` or `slave` (prefer slave in tests so UART stays up)
|
||||
`expect`: `success`
|
||||
|
||||
**ota_progress** — query `OTA_SLAVE_PROGRESS` (no firmware upload)
|
||||
`input`: optional `client_id` / `slave`
|
||||
`expect`: `active` (typically `false` when idle)
|
||||
|
||||
**reset** — esptool hard-reset via console port from bench config (no `expect`).
|
||||
`input`: `target` (`master`) or `slave` (`pod-1`), or `all: true`; optional `wait_ms` after each reset (default 2000).
|
||||
|
||||
@@ -56,13 +69,19 @@ Example reset steps:
|
||||
|
||||
Requires `python -m esptool` or `esptool.py` on PATH (ESP-IDF).
|
||||
|
||||
The `smoke` scenario resets every node with a configured `console` port, waits **10 s** for boot and ESP-NOW join, then runs the UART checks.
|
||||
The `smoke` scenario resets every node with a configured `console` port, waits **10 s** for boot and ESP-NOW join, then runs a short UART smoke test.
|
||||
|
||||
The **`uart_cmds`** scenario covers all implemented UART commands **except OTA upload** (`OTA_START` / `OTA_PAYLOAD` / `OTA_END` / `OTA_START_ESPNOW`). It ends with a slave **restart** (master UART stays connected).
|
||||
|
||||
`CLIENT_INPUT` is not tested (not implemented in firmware).
|
||||
|
||||
### Example
|
||||
|
||||
```bash
|
||||
cd goTool
|
||||
go run . test -config example-lab -scenario smoke
|
||||
go run . test -config example-lab -scenario uart_cmds
|
||||
go run . test -config my-lab -scenario smoke -port /dev/ttyUSB1
|
||||
go run . test -list-configs
|
||||
go run . test -list-scenarios
|
||||
```
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"id": "uart_cmds",
|
||||
"description": "All implemented UART commands (no OTA upload). Resets bench, joins ESP-NOW, exercises each cmd; restarts slave at end.",
|
||||
"config": "example-lab",
|
||||
"steps": [
|
||||
{
|
||||
"name": "reset all nodes",
|
||||
"command": "reset",
|
||||
"input": { "all": true, "wait_ms": 2500 }
|
||||
},
|
||||
{
|
||||
"name": "boot and ESP-NOW join",
|
||||
"delay_ms": 10000
|
||||
},
|
||||
{
|
||||
"name": "VERSION",
|
||||
"command": "version",
|
||||
"expect": { "version_min": 1 }
|
||||
},
|
||||
{
|
||||
"name": "CLIENT_INFO",
|
||||
"command": "clients",
|
||||
"expect": {
|
||||
"min_clients": 1,
|
||||
"slave": "pod-1",
|
||||
"available": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ACCEL_DEADZONE read master",
|
||||
"command": "deadzone",
|
||||
"input": { "write": false, "client": 0 },
|
||||
"expect": { "success": true }
|
||||
},
|
||||
{
|
||||
"name": "ACCEL_DEADZONE write master",
|
||||
"command": "deadzone",
|
||||
"input": { "write": true, "client": 0, "value": 120 },
|
||||
"expect": { "success": true, "deadzone": 120 }
|
||||
},
|
||||
{
|
||||
"name": "ACCEL_DEADZONE read master after write",
|
||||
"command": "deadzone",
|
||||
"input": { "write": false, "client": 0 },
|
||||
"expect": { "success": true, "deadzone": 120 }
|
||||
},
|
||||
{
|
||||
"name": "LED_RING clear",
|
||||
"command": "led_ring",
|
||||
"input": { "mode": "clear" },
|
||||
"expect": { "success": true, "mode": 0 }
|
||||
},
|
||||
{
|
||||
"name": "LED_RING progress",
|
||||
"command": "led_ring",
|
||||
"input": { "mode": "progress", "progress": 40, "g": 200 },
|
||||
"expect": { "success": true, "mode": 1, "progress": 40 }
|
||||
},
|
||||
{
|
||||
"name": "LED_RING digit",
|
||||
"command": "led_ring",
|
||||
"input": { "mode": "digit", "digit": 3, "r": 255 },
|
||||
"expect": { "success": true, "mode": 2, "digit": 3 }
|
||||
},
|
||||
{
|
||||
"name": "LED_RING blink",
|
||||
"command": "led_ring",
|
||||
"input": { "mode": "blink", "r": 0, "g": 255, "b": 0, "blink_count": 1 },
|
||||
"expect": { "success": true, "mode": 3 }
|
||||
},
|
||||
{
|
||||
"name": "ESPNOW_UNICAST_TEST",
|
||||
"command": "unicast_test",
|
||||
"input": { "slave": "pod-1", "seq": 99 },
|
||||
"expect": { "success": true, "seq": 99 }
|
||||
},
|
||||
{
|
||||
"name": "FIND_ME master",
|
||||
"command": "find_me",
|
||||
"input": { "client": 0 },
|
||||
"expect": { "success": true }
|
||||
},
|
||||
{
|
||||
"name": "FIND_ME slave",
|
||||
"command": "find_me",
|
||||
"input": { "slave": "pod-1" },
|
||||
"expect": { "success": true }
|
||||
},
|
||||
{
|
||||
"name": "ACCEL_DEADZONE push to slave",
|
||||
"command": "deadzone",
|
||||
"input": { "write": true, "slave": "pod-1", "value": 110 },
|
||||
"expect": { "success": true }
|
||||
},
|
||||
{
|
||||
"name": "OTA_SLAVE_PROGRESS idle",
|
||||
"command": "ota_progress",
|
||||
"expect": { "active": false }
|
||||
},
|
||||
{
|
||||
"name": "RESTART slave (last)",
|
||||
"command": "restart",
|
||||
"input": { "slave": "pod-1" },
|
||||
"expect": { "success": true }
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user