Beispiel #1
0
 def test_get_router_ips_from_ib_network(self):
     connector = mock.Mock()
     test_ib_network = ib_objects.NetworkV4(connector,
                                            network_view='test-view',
                                            cidr='12.12.1.0/24')
     test_ib_network.options = [
         ib_objects.DhcpOption(name='routers',
                               value='192.168.1.1,192.168.1.2')]
     member_ips = utils.get_router_ips(test_ib_network)
     self.assertEqual("192.168.1.1", member_ips[0])
     self.assertEqual("192.168.1.2", member_ips[1])
Beispiel #2
0
 def test_get_router_ips_from_network_json(self):
     network_json = {
         "options": [{
             "name": "routers",
             "num": 3,
             "use_option": True,
             "value": "192.168.1.1,192.168.1.2",
             "vendor_class": "DHCP"
         }]
     }
     member_ips = utils.get_router_ips(network_json)
     self.assertEqual("192.168.1.1", member_ips[0])
     self.assertEqual("192.168.1.2", member_ips[1])
 def test_get_router_ips_from_network_json(self):
     network_json = {
         "options": [
             {
                 "name": "routers",
                 "num": 3,
                 "use_option": True,
                 "value": "192.168.1.1,192.168.1.2",
                 "vendor_class": "DHCP"
             }
         ]
     }
     member_ips = utils.get_router_ips(network_json)
     self.assertEqual("192.168.1.1", member_ips[0])
     self.assertEqual("192.168.1.2", member_ips[1])