powerpods/goTool/autotest/config_test.go
simon 0299ba44fd 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>
2026-05-18 23:44:58 +02:00

33 lines
586 B
Go

package autotest
import "testing"
func TestNewBenchClientIDFromMAC(t *testing.T) {
cfg := Config{
ID: "t",
Network: 1,
MasterMAC: "aa:bb:cc:dd:ee:ff",
UART: UARTConfig{
Master: "/dev/ttyUSB0",
},
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")
}
}