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:
2026-05-18 23:36:28 +02:00
co-authored by Cursor
parent a8ae65d9dc
commit d24b0cb5c3
17 changed files with 958 additions and 106 deletions
+1 -20
View File
@@ -2,32 +2,13 @@ package main
import (
"fmt"
"google.golang.org/protobuf/proto"
"powerpod/gotool/pb"
)
func runVersion(sp *serialPort) error {
payload, err := sp.exchange(byte(pb.MessageType_VERSION), "VERSION")
ver, err := sp.getVersion()
if err != nil {
return err
}
var msg pb.UartMessage
if err := proto.Unmarshal(payload[1:], &msg); err != nil {
return fmt.Errorf("decode protobuf: %w", err)
}
if msg.GetType() != pb.MessageType_VERSION {
return fmt.Errorf("unexpected message type %v", msg.GetType())
}
ver := msg.GetVersionResponse()
if ver == nil {
return fmt.Errorf("response missing version_response")
}
fmt.Printf("version: %d\n", ver.GetVersion())
fmt.Printf("git_hash: %s\n", ver.GetGitHash())
return nil