Nmap Development mailing list archives

Re: Reduce zenmap topology noise (patch)


From: Colin L Rice <ricec2 () rpi edu>
Date: Tue, 03 Jan 2012 23:51:11 -0800

On 12-01-03 11:42 PM, Anders Sundman wrote:
On 2011-12-31 01:36, Colin L Rice wrote:
On 11-12-29 06:26 AM, Patrik Karlsson wrote:
2011/12/14, Anders Sundman<anders () 4zm org>:
I suggest combining nodes in the graph that represent anonymous hops
between two known devices.

Here is a patch implementing this behavior:

http://www.4zm.org/files/2011/integration.py.diff
Could some Zenmap guru take a look at this patch so that we can make a
decision whether to commit it or not?

I'm no guru but I've done some zenmap patch work. The obvious thing it
is missing is some testcases. I don't remember if we have built them
into radialnet but we have them in zenmap and It'd be nice if we kept
them maintained.
I'm all for unit tests, but I could not find any test cases anywhere.
Where can they be found and what test framework does (ze)nmap use?

If you look in zenmap/zenmapCore most of the files have unittest testcases.
If you want you can just add the test cases to the radialnet files.

An example from NetworkInventory.py

class PortChangeTest(unittest.TestCase):
    def test_port(self):
"""Verify that the port status (open/filtered/closed) is diplayed """ \
        """correctly when the port status changes in newer scans"""
        from zenmapCore.NmapParser import NmapParser
        inv = NetworkInventory()
        scan1 = NmapParser()
        scan1.parse_file("test/xml_test13.xml")
        inv.add_scan(scan1)
        scan2 = NmapParser()
        scan2.parse_file("test/xml_test14.xml")
        inv.add_scan(scan2)
        assert(len(inv.get_hosts()[0].ports) == 2)

if __name__ == "__main__":
    unittest.main()

Just FYI this is zenmap's test suite. Ncat has a giant perl script of doom and nmap has nothing that I know of.

-Colin
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: