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
+29
View File
@@ -0,0 +1,29 @@
package autotest
import "testing"
func TestNewBenchClientIDFromMAC(t *testing.T) {
cfg := Config{
ID: "t",
Network: 1,
MasterMAC: "aa:bb:cc:dd:ee:ff",
Slaves: []SlaveNode{{
ID: "pod",
MAC: "50:78:7d:18:01:10",
}},
}
b, err := NewBench(cfg)
if err != nil {
t.Fatal(err)
}
s, _ := b.Slave("pod")
if *s.ClientID != 16 {
t.Fatalf("client_id=%d want 16", *s.ClientID)
}
}
func TestMACEqual(t *testing.T) {
if !MACEqual("50:78:7D:18:01:10", "50-78-7d-18-01-10") {
t.Fatal("MACEqual failed")
}
}