Esempio n. 1
0
 def test9_initial_dhcp_hash_compare(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     dc = DHCPHashCompare(a_hashed_list, 'KeyValue List', b_hashed_list, 'StaticINTR Generated')
     identical, lists = dc.compare_lists(a_hashed_list, b_hashed_list)
     self.assertTrue(identical)
     self.assertEqual(lists[0], lists[1])
 def test9_initial_dhcp_hash_compare(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     dc = DHCPHashCompare(a_hashed_list, 'KeyValue List', b_hashed_list,
                          'StaticINTR Generated')
     identical, lists = dc.compare_lists(a_hashed_list, b_hashed_list)
     self.assertTrue(identical)
     self.assertEqual(lists[0], lists[1])
Esempio n. 3
0
    def test10_initial_dhcp_hash_compare_missing_host(self):
        a = DHCPHash(self.new_file)
        b = DHCPHash(self.new_file)
        a_hashed_list = a.get_hash()
        b_hashed_list = b.get_hash()

        del a_hashed_list[1]
        del b_hashed_list[1]
        del a_hashed_list[1]
        ## Pick the first object from the hash and give it a new and different value
        a_hashed_list[0]['hardware ethernet'] = '00:00:00:00:00:00'
        a_hashed_list[0]['fixed-address'] = '10.0.0.1'
        dc = DHCPHashCompare(a_hashed_list, 'KeyValue List', b_hashed_list, 'StaticINTR Generated')
        identical, lists = dc.compare_lists(a_hashed_list, b_hashed_list)
        self.assertFalse(identical)
        msg = dc.analyze()
        print msg
    def test10_initial_dhcp_hash_compare_missing_host(self):
        a = DHCPHash(self.new_file)
        b = DHCPHash(self.new_file)
        a_hashed_list = a.get_hash()
        b_hashed_list = b.get_hash()

        del a_hashed_list[1]
        del b_hashed_list[1]
        del a_hashed_list[1]
        ## Pick the first object from the hash and give it a new and different value
        a_hashed_list[0]['hardware ethernet'] = '00:00:00:00:00:00'
        a_hashed_list[0]['fixed-address'] = '10.0.0.1'
        dc = DHCPHashCompare(a_hashed_list, 'KeyValue List', b_hashed_list,
                             'StaticINTR Generated')
        identical, lists = dc.compare_lists(a_hashed_list, b_hashed_list)
        self.assertFalse(identical)
        msg = dc.analyze()
        print msg