powerpods/goTool/autotest/config_test.go
simon d24b0cb5c3 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>
2026-05-18 23:36:28 +02:00

30 lines
534 B
Go

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")
}
}