mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
Improving Mac discovery
This commit is contained in:
committed by
Cuong Manh Le
parent
3007cb86ec
commit
76d2e2c226
@@ -0,0 +1,23 @@
|
||||
package clientinfo
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestArpScan(t *testing.T) {
|
||||
a := &arpDiscover{}
|
||||
a.scan()
|
||||
|
||||
for _, table := range []*sync.Map{&a.mac, &a.ip} {
|
||||
count := 0
|
||||
table.Range(func(key, value any) bool {
|
||||
count++
|
||||
t.Logf("%s => %s", key, value)
|
||||
return true
|
||||
})
|
||||
if count == 0 {
|
||||
t.Error("empty result from arp scan")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user