overflow_discovery/net/zone_test.go
crusader 44bc4f51d8 ing
2017-10-26 21:55:55 +09:00

33 lines
411 B
Go

package net
import (
"testing"
)
func TestScanZone(t *testing.T) {
dzc := &DiscoveryZoneConfig{
ExcludePatterns: []string{`^br-`, `^docker`},
}
zs := newZoneScan(dzc)
defer func() {
zs.Close()
}()
go scanZone(zs)
Loop:
for {
select {
case zone := <-zs.zoneChan:
t.Logf("zone: %v", zone)
case err := <-zs.logChan:
t.Logf("log: %v", err)
case <-zs.endChan:
break Loop
}
}
}