Add bench UART ports and cold-start reset to goTool autotest.
Bench configs define command and console serial paths; scenarios can reset nodes via esptool before tests. Smoke resets all nodes then waits for ESP-NOW join. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -92,11 +92,42 @@ func runStep(bench *Bench, step Step, client MasterClient) error {
|
||||
return checkDeadzone(bench, step, client)
|
||||
case "unicast_test", "unicast":
|
||||
return checkUnicastTest(bench, step, client)
|
||||
case "reset", "reboot":
|
||||
return checkReset(bench, step)
|
||||
default:
|
||||
return fmt.Errorf("unknown command %q", step.Command)
|
||||
}
|
||||
}
|
||||
|
||||
type resetInput struct {
|
||||
Target string `json:"target"`
|
||||
Slave string `json:"slave"`
|
||||
All bool `json:"all"`
|
||||
WaitMS int `json:"wait_ms"`
|
||||
}
|
||||
|
||||
func checkReset(bench *Bench, step Step) error {
|
||||
var in resetInput
|
||||
if len(step.Input) > 0 {
|
||||
if err := json.Unmarshal(step.Input, &in); err != nil {
|
||||
return fmt.Errorf("input: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if in.All {
|
||||
return bench.ResetAll(in.WaitMS)
|
||||
}
|
||||
|
||||
target := in.Target
|
||||
if in.Slave != "" {
|
||||
target = in.Slave
|
||||
}
|
||||
if target == "" {
|
||||
target = "master"
|
||||
}
|
||||
return bench.ResetTargets([]string{target}, in.WaitMS)
|
||||
}
|
||||
|
||||
func checkVersion(step Step, client MasterClient) error {
|
||||
ver, err := client.GetVersion()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user