PAPI: Add MACAddress object wrapper for vl_api_mac_address_t
[vpp.git] / test / test_l2bd_arp_term.py
index 23742b1..2321aa7 100644 (file)
@@ -19,9 +19,7 @@ from scapy.layers.inet6 import IPv6, UDP, ICMPv6ND_NS, ICMPv6ND_RS, \
     ICMPv6ND_NA, ICMPv6NDOptDstLLAddr, ICMPv6DestUnreach, icmp6types
 
 from framework import VppTestCase, VppTestRunner
-from util import Host, ppp, mactobinary
-from vpp_mac import VppMacAddress
-from vpp_ip import VppIpAddress
+from util import Host, ppp
 
 
 class TestL2bdArpTerm(VppTestCase):
@@ -73,8 +71,8 @@ class TestL2bdArpTerm(VppTestCase):
         for e in entries:
             ip = e.ip4 if is_ipv6 == 0 else e.ip6
             self.vapi.bd_ip_mac_add_del(bd_id=bd_id,
-                                        mac=VppMacAddress(e.mac).encode(),
-                                        ip=VppIpAddress(ip).encode(),
+                                        mac=e.mac,
+                                        ip=ip,
                                         is_ipv6=is_ipv6,
                                         is_add=is_add)
 
@@ -156,12 +154,13 @@ class TestL2bdArpTerm(VppTestCase):
     def arp_resp_hosts(self, src_host, pkts):
         return {self.arp_resp_host(src_host, p) for p in pkts}
 
-    def inttoip4(self, ip):
+    @staticmethod
+    def inttoip4(ip):
         o1 = int(ip / 16777216) % 256
         o2 = int(ip / 65536) % 256
         o3 = int(ip / 256) % 256
         o4 = int(ip) % 256
-        return '%(o1)s.%(o2)s.%(o3)s.%(o4)s' % locals()
+        return '%s.%s.%s.%s' % (o1, o2, o3, o4)
 
     def arp_event_host(self, e):
         return Host(mac=':'.join(['%02x' % ord(char) for char in e.new_mac]),