prefix = subnet['cidr']
ip_address = ipv6_utils.get_ipv6_addr_by_EUI64(
prefix, mac)
+ if not self._check_unique_ip(
+ context, p['network_id'],
+ subnet['id'], ip_address.format()):
+ raise n_exc.IpAddressInUse(
+ net_id=p['network_id'],
+ ip_address=ip_address.format())
ips.append({'ip_address': ip_address.format(),
'subnet_id': subnet['id']})
v6.remove(subnet)
def test_ip_allocation_for_ipv6_subnet_slaac_adddress_mode(self):
self.skipTest("NVSD Plugin does not support IPV6.")
+ def test_generated_duplicate_ip_ipv6(self):
+ self.skipTest("NVSD Plugin does not support IPV6.")
+
class TestOneConvergenceBasicGet(test_plugin.TestBasicGet,
OneConvergencePluginV2TestCase):
res = self._create_port(self.fmt, net_id=net_id, **kwargs)
self.assertEqual(res.status_int, webob.exc.HTTPConflict.code)
+ def test_generated_duplicate_ip_ipv6(self):
+ with self.subnet(ip_version=6,
+ cidr="2014::/64",
+ ipv6_address_mode=constants.IPV6_SLAAC) as subnet:
+ with self.port(subnet=subnet,
+ fixed_ips=[{'subnet_id': subnet['subnet']['id'],
+ 'ip_address':
+ "2014::1322:33ff:fe44:5566"}]) as port:
+ # Check configuring of duplicate IP
+ kwargs = {"mac_address": "11:22:33:44:55:66"}
+ net_id = port['port']['network_id']
+ res = self._create_port(self.fmt, net_id=net_id, **kwargs)
+ self.assertEqual(res.status_int, webob.exc.HTTPConflict.code)
+
def test_requested_subnet_delete(self):
with self.subnet() as subnet:
with self.port(subnet=subnet) as port: