Exemplo n.º 1
0
 def test_find_port_address_with_subnet_id(self):
     port = neutron.find_port(device_id=self.stack.server_id)
     for subnet in neutron.list_subnets(network_id=port['network_id']):
         port_address = neutron.find_port_ip_address(
             port=port, subnet_id=subnet['id'], unique=True)
         cidr = netaddr.IPNetwork(subnet['cidr'])
         self.assertIn(port_address, cidr)
Exemplo n.º 2
0
 def test_find_port_address_with_ip_version(self):
     port = neutron.find_port(device_id=self.stack.server_id)
     server_addresses = nova.list_server_ip_addresses(
         server=self.stack.server_details, address_type='fixed')
     for server_address in server_addresses:
         port_address = neutron.find_port_ip_address(
             port=port, ip_version=server_address.version, unique=True)
         self.assertEqual(server_address, port_address)
Exemplo n.º 3
0
 def test_list_port_addresses(self, ip_version=None):
     port = neutron.find_port(device_id=self.stack.server_id)
     port_addresses = neutron.list_port_ip_addresses(port=port,
                                                     ip_version=ip_version)
     server_addresses = nova.list_server_ip_addresses(
         server=self.stack.server_details,
         ip_version=ip_version,
         address_type='fixed')
     self.assertEqual(set(server_addresses), set(port_addresses))
     if ip_version:
         self.assertEqual(
             port_addresses.with_attributes(version=ip_version),
             port_addresses)