test/vpp_ip_route.py: Trivial. Remove duplicate key.
[vpp.git] / test / vpp_interface.py
index 719f77b..2dcf149 100644 (file)
@@ -1,16 +1,17 @@
 import binascii
 import socket
-from abc import abstractmethod, ABCMeta
+import abc
 
+import six
 from six import moves
 
 from util import Host, mk_ll_addr
-from vpp_papi import mac_pton, mac_ntop
+from vpp_papi import mac_ntop
 
 
+@six.add_metaclass(abc.ABCMeta)
 class VppInterface(object):
     """Generic VPP interface."""
-    __metaclass__ = ABCMeta
 
     @property
     def sw_if_index(self):
@@ -181,7 +182,7 @@ class VppInterface(object):
             self._hosts_by_ip4[ip4] = host
             self._hosts_by_ip6[ip6] = host
 
-    @abstractmethod
+    @abc.abstractmethod
     def __init__(self, test):
         self._test = test
 
@@ -273,10 +274,9 @@ class VppInterface(object):
         :param vrf_id: The FIB table / VRF ID. (Default value = 0)
         """
         for host in self._remote_hosts:
-            macn = mac_pton(host.mac)
-            ipn = host.ip4n
-            self.test.vapi.ip_neighbor_add_del(
-                self.sw_if_index, macn, ipn)
+            self.test.vapi.ip_neighbor_add_del(self.sw_if_index,
+                                               host.mac,
+                                               host.ip4)
 
     def config_ip6(self):
         """Configure IPv6 address on the VPP interface."""
@@ -304,10 +304,9 @@ class VppInterface(object):
         :param vrf_id: The FIB table / VRF ID. (Default value = 0)
         """
         for host in self._remote_hosts:
-            macn = mac_pton(host.mac)
-            ipn = host.ip6n
-            self.test.vapi.ip_neighbor_add_del(
-                self.sw_if_index, macn, ipn, is_ipv6=1)
+            self.test.vapi.ip_neighbor_add_del(self.sw_if_index,
+                                               host.mac,
+                                               host.ip6)
 
     def unconfig(self):
         """Unconfigure IPv6 and IPv4 address on the VPP interface."""