Browse Source

Merge "Fix get_ipv6_llas method in the interface driver" into stable/ussuri

changes/58/748958/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
9bc09146a1
2 changed files with 19 additions and 0 deletions
  1. +3
    -0
      neutron/agent/linux/ip_lib.py
  2. +16
    -0
      neutron/tests/functional/agent/linux/test_interface.py

+ 3
- 0
neutron/agent/linux/ip_lib.py View File

@@ -1361,6 +1361,9 @@ def get_devices_with_ip(namespace, name=None, **kwargs):
link_args = {}
if name:
link_args['ifname'] = name
scope = kwargs.pop('scope', None)
if scope:
kwargs['scope'] = IP_ADDRESS_SCOPE_NAME[scope]
devices = privileged.get_link_devices(namespace, **link_args)
retval = []
for parsed_ips in (_parse_link_device(namespace, device, **kwargs)


+ 16
- 0
neutron/tests/functional/agent/linux/test_interface.py View File

@@ -69,6 +69,22 @@ class InterfaceDriverTestCaseMixin(object):
self.interface.set_mtu,
device_name=device_name, namespace=namespace))

def test_ipv6_lla_create_and_get(self):
lla_address = "fe80::f816:3eff:fe66:73bf/64"
global_address = "2001::1/64"
device_name = utils.get_rand_name()
namespace = self.useFixture(net_helpers.NamespaceFixture())
namespace.ip_wrapper.add_dummy(device_name)
self.interface.add_ipv6_addr(
device_name, lla_address, namespace.name, 'link')
self.interface.add_ipv6_addr(
device_name, global_address, namespace.name, 'global')
existing_addresses = [
a['cidr'] for a in self.interface.get_ipv6_llas(
device_name, namespace.name)]
self.assertIn(lla_address, existing_addresses)
self.assertNotIn(global_address, existing_addresses)


class OVSInterfaceDriverTestCase(linux_base.BaseOVSLinuxTestCase,
InterfaceDriverTestCaseMixin):


Loading…
Cancel
Save