From 3d3e3b8515ac7eb587d565b856b87a12a1b857e4 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 10 Jul 2009 23:28:28 +0000 Subject: [PATCH] Regnerate test scan files, add script scanning, version detection, and OS detection to complex.xml. --- ndiff/ndifftest.py | 6 +++--- ndiff/test-scans/complex.xml | 38 +++++++++++++++++++++++------------- ndiff/test-scans/down.xml | 10 +++++----- ndiff/test-scans/empty.xml | 10 +++++----- ndiff/test-scans/os.xml | 24 +++++++++++------------ ndiff/test-scans/simple.xml | 18 ++++++++--------- ndiff/test-scans/single.xml | 24 +++++++++++------------ 7 files changed, 70 insertions(+), 60 deletions(-) diff --git a/ndiff/ndifftest.py b/ndiff/ndifftest.py index f2dfa6ee0..193429311 100755 --- a/ndiff/ndifftest.py +++ b/ndiff/ndifftest.py @@ -46,8 +46,8 @@ class scan_test(unittest.TestCase): scan = Scan() scan.load_from_file("test-scans/complex.xml") host = scan.hosts[0] - self.assertEqual(len(host.ports), 5) - self.assertEqual(set(host.extraports.items()), set([("filtered", 95), ("open|filtered", 100)])) + self.assertEqual(len(host.ports), 6) + self.assertEqual(set(host.extraports.items()), set([("filtered", 95), ("open|filtered", 99)])) def test_addresses(self): """Test that addresses are recorded.""" @@ -66,7 +66,7 @@ class scan_test(unittest.TestCase): def test_os(self): """Test that OS information is recorded.""" scan = Scan() - scan.load_from_file("test-scans/os.xml") + scan.load_from_file("test-scans/complex.xml") host = scan.hosts[0] self.assertTrue(len(host.os) > 0) diff --git a/ndiff/test-scans/complex.xml b/ndiff/test-scans/complex.xml index bcd6a8a18..ff9f2aa98 100644 --- a/ndiff/test-scans/complex.xml +++ b/ndiff/test-scans/complex.xml @@ -1,29 +1,39 @@ - + - - + + - +
- - + + - - - - - +