Add unit test with ipv4 and MAC addr

This commit is contained in:
Brendan Le Glaunec
2018-07-03 14:12:22 +02:00
committed by Brendan LE GLAUNEC
parent 456f7fffc5
commit fd83be9d95
+36
View File
@@ -207,6 +207,42 @@ func TestNmapParseResults(t *testing.T) {
},
},
// File exists
// Valid stream, an ipv4 address and a mac address
{
fileExists: true,
expectedStreams: []Stream{validStream1},
streamsXML: &nmapResult{
Hosts: []host{
{
Addresses: []address{
address{
Addr: invalidStreamMACAddress.Address,
AddrType: "mac",
},
address{
Addr: validStream1.Address,
AddrType: "ipv4",
},
},
Ports: ports{
Ports: []port{
{
PortID: validStream1.Port,
State: state{
State: "open",
},
Service: service{
Name: "rtsp",
Product: validStream1.Device,
},
},
},
},
},
},
},
},
// File exists
// Two invalid targets, no error
{
fileExists: true,