From fd83be9d954c641d0151b32eaf80f49abf5c9e2c Mon Sep 17 00:00:00 2001 From: Brendan Le Glaunec Date: Tue, 3 Jul 2018 14:12:22 +0200 Subject: [PATCH] Add unit test with ipv4 and MAC addr --- discover_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/discover_test.go b/discover_test.go index ab65a97..9a5e8cd 100644 --- a/discover_test.go +++ b/discover_test.go @@ -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,