diff options
Diffstat (limited to 'test/vpp_interface.py')
-rw-r--r-- | test/vpp_interface.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/vpp_interface.py b/test/vpp_interface.py index e14a31eb722..1db34ba7958 100644 --- a/test/vpp_interface.py +++ b/test/vpp_interface.py @@ -1,7 +1,7 @@ from abc import abstractmethod, ABCMeta import socket -from util import Host, mk_ll_addr +from util import Host, mk_ll_addr, mactobinary class VppInterface(object): @@ -170,6 +170,13 @@ class VppInterface(object): self._hosts_by_ip4 = {} self._hosts_by_ip6 = {} + def set_mac(self, mac): + self._local_mac = mac + self._local_ip6_ll = mk_ll_addr(mac) + self.test.vapi.sw_interface_set_mac_address( + self.sw_if_index, + mactobinary(self._local_mac)) + def set_sw_if_index(self, sw_if_index): self._sw_if_index = sw_if_index |