aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-01-18 19:24:34 +0100
committerNeale Ranns <neale@graphiant.com>2021-01-20 13:52:11 +0000
commit58a1915b501845c47676d529ff3b5840a876e39d (patch)
tree34988661db0ce60387e00a19fea18ee8c32b916f /test
parentb2525922cd7932413a370c212c09485367d15464 (diff)
ip: add API to retrieve IPv6 link-layer address
Type: feature Change-Id: I5739869490155b0b9674b4faf61882d97e66a4ed Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/vpp_interface.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/vpp_interface.py b/test/vpp_interface.py
index 32d8166fc43..7eb586c010c 100644
--- a/test/vpp_interface.py
+++ b/test/vpp_interface.py
@@ -97,6 +97,10 @@ class VppInterface(metaclass=abc.ABCMeta):
@property
def local_ip6_ll(self):
"""Local IPv6 link-local address on VPP interface (string)."""
+ if not self._local_ip6_ll:
+ self._local_ip6_ll = str(
+ self.test.vapi.sw_interface_ip6_get_link_local_address(
+ self.sw_if_index).ip)
return self._local_ip6_ll
@property
@@ -192,7 +196,6 @@ class VppInterface(metaclass=abc.ABCMeta):
def set_mac(self, mac):
self._local_mac = str(mac)
- self._local_ip6_ll = mk_ll_addr(self._local_mac)
self.test.vapi.sw_interface_set_mac_address(
self.sw_if_index, mac.packed)
return self
@@ -234,8 +237,8 @@ class VppInterface(metaclass=abc.ABCMeta):
"Could not find interface with sw_if_index %d "
"in interface dump %s" %
(self.sw_if_index, moves.reprlib.repr(r)))
- self._local_ip6_ll = mk_ll_addr(self.local_mac)
self._remote_ip6_ll = mk_ll_addr(self.remote_mac)
+ self._local_ip6_ll = None
def config_ip4(self):
"""Configure IPv4 address on the VPP interface."""