Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ip: add API to retrieve IPv6 link-layer address
[vpp.git]
/
test
/
vpp_interface.py
diff --git
a/test/vpp_interface.py
b/test/vpp_interface.py
index
2d991ed
..
7eb586c
100644
(file)
--- a/
test/vpp_interface.py
+++ b/
test/vpp_interface.py
@@
-2,9
+2,6
@@
import binascii
import socket
import abc
import socket
import abc
-import six
-from six import moves
-
from util import Host, mk_ll_addr
from vpp_papi import mac_ntop, VppEnum
from ipaddress import IPv4Network, IPv6Network
from util import Host, mk_ll_addr
from vpp_papi import mac_ntop, VppEnum
from ipaddress import IPv4Network, IPv6Network
@@
-15,8
+12,7
@@
except NameError:
text_type = str
text_type = str
-@six.add_metaclass(abc.ABCMeta)
-class VppInterface(object):
+class VppInterface(metaclass=abc.ABCMeta):
"""Generic VPP interface."""
@property
"""Generic VPP interface."""
@property
@@
-101,6
+97,10
@@
class VppInterface(object):
@property
def local_ip6_ll(self):
"""Local IPv6 link-local address on VPP interface (string)."""
@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
return self._local_ip6_ll
@property
@@
-196,7
+196,6
@@
class VppInterface(object):
def set_mac(self, mac):
self._local_mac = str(mac)
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
self.test.vapi.sw_interface_set_mac_address(
self.sw_if_index, mac.packed)
return self
@@
-238,8
+237,8
@@
class VppInterface(object):
"Could not find interface with sw_if_index %d "
"in interface dump %s" %
(self.sw_if_index, moves.reprlib.repr(r)))
"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._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."""
def config_ip4(self):
"""Configure IPv4 address on the VPP interface."""
@@
-438,8
+437,8
@@
class VppInterface(object):
def set_proxy_arp(self, enable=1):
""" Set the interface to enable/disable Proxy ARP """
self.test.vapi.proxy_arp_intfc_enable_disable(
def set_proxy_arp(self, enable=1):
""" Set the interface to enable/disable Proxy ARP """
self.test.vapi.proxy_arp_intfc_enable_disable(
- self.sw_if_index,
- enable)
+ s
w_if_index=s
elf.sw_if_index,
+ enable
=enable
)
return self
def query_vpp_config(self):
return self
def query_vpp_config(self):