def test_scandata_parsing(self):
'''Tests parsing of the basic surface scan'''
scan = ndr.NmapScan()
scan.parse_nmap_xml(load_nmap_xml_data(TEST_SURFACE_SCAN_DATA))
self.assertEqual(5, len(scan))
# Got three hosts, find a host by MAC address
host = scan.find_by_mac('84:39:BE:64:3F:E5')[0]
# SHould only find one IP address
self.assertNotEqual(None, host)
self.assertTrue(host.addr, ipaddress.ip_address("192.168.2.100"))
self.assertEqual(host.reason, ndr.NmapReasons.ARP_RESPONSE)
# Confirm that we're not finding phantom hosts
self.assertEqual(scan.find_by_mac('NOT_A_REAL_MAC'), None)
评论列表
文章目录