2018-08-29 12:04:23 +00:00
|
|
|
package snmp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-08-30 12:56:32 +00:00
|
|
|
"git.loafle.net/overflow_scanner/probe/discovery"
|
|
|
|
"git.loafle.net/overflow_scanner/probe/discovery/session"
|
|
|
|
"git.loafle.net/overflow_scanner/probe/discovery/types"
|
2018-08-29 12:04:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestSNMPScan(t *testing.T) {
|
2018-08-30 12:56:32 +00:00
|
|
|
s := session.MockDiscoverySession()
|
|
|
|
s.InitWithRequest(
|
|
|
|
discovery.MockDiscoveryRequest(
|
|
|
|
"testRequester",
|
|
|
|
types.DiscoveryRequestTypeHost,
|
|
|
|
[]interface{}{
|
|
|
|
&omd.Zone{
|
|
|
|
Network: "192.168.1.0/24",
|
|
|
|
Iface: "enp3s0",
|
|
|
|
MetaIPType: omm.ToMetaIPType(omm.MetaIPTypeEnumV4),
|
|
|
|
Address: "192.168.1.101",
|
|
|
|
Mac: "44:8a:5b:f1:f1:f3",
|
|
|
|
},
|
|
|
|
&omd.DiscoverHost{
|
|
|
|
MetaIPType: omm.ToMetaIPType(omm.MetaIPTypeEnumV4),
|
|
|
|
FirstScanRange: "192.168.1.1",
|
|
|
|
LastScanRange: "192.168.1.254",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
)
|
2018-08-29 12:04:23 +00:00
|
|
|
|
2018-08-30 12:56:32 +00:00
|
|
|
Scan(s)
|
2018-08-29 12:04:23 +00:00
|
|
|
|
|
|
|
t.Log(msg)
|
|
|
|
|
|
|
|
}
|