test framework: vpp_papi_provider.py - further cleanup
[vpp.git] / test / test_l2bd_arp_term.py
index f25be57..f721131 100644 (file)
@@ -20,7 +20,6 @@ from scapy.layers.inet6 import IPv6, UDP, ICMPv6ND_NS, ICMPv6ND_RS, \
 
 from framework import VppTestCase, VppTestRunner
 from util import Host, ppp
-from vpp_mac import VppMacAddress, mactobinary
 
 
 class TestL2bdArpTerm(VppTestCase):
@@ -71,11 +70,8 @@ class TestL2bdArpTerm(VppTestCase):
     def add_del_arp_term_hosts(self, entries, bd_id=1, is_add=1, is_ipv6=0):
         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=ip,
-                                        is_ipv6=is_ipv6,
-                                        is_add=is_add)
+            self.vapi.bd_ip_mac_add_del(bd_id=bd_id, is_add=is_add, ip=ip,
+                                        mac=e.mac)
 
     @classmethod
     def mac_list(cls, b6_range):
@@ -164,15 +160,13 @@ class TestL2bdArpTerm(VppTestCase):
         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]),
-                    ip4=self.inttoip4(e.address))
+        return Host(str(e.mac), ip4=str(e.ip))
 
     def arp_event_hosts(self, evs):
         return {self.arp_event_host(e) for e in evs}
 
     def nd_event_host(self, e):
-        return Host(mac=':'.join(['%02x' % ord(char) for char in e.new_mac]),
-                    ip6=inet_ntop(AF_INET6, e.address))
+        return Host(str(e.mac), ip6=str(e.ip))
 
     def nd_event_hosts(self, evs):
         return {self.nd_event_host(e) for e in evs}
@@ -440,7 +434,7 @@ class TestL2bdArpTerm(VppTestCase):
     def test_l2bd_arp_term_12(self):
         """ L2BD ND term - send NS packets verify reports
         """
-        self.vapi.want_ip6_nd_events(address=inet_pton(AF_INET6, "::0"))
+        self.vapi.want_ip6_nd_events(ip="::")
         dst_host = self.ip6_host(50, 50, "00:00:11:22:33:44")
         self.bd_add_del(1, is_add=1)
         self.set_bd_flags(1, arp_term=True, flood=False,
@@ -476,8 +470,7 @@ class TestL2bdArpTerm(VppTestCase):
     def test_l2bd_arp_term_14(self):
         """ L2BD ND term - disable ip4 arp events,send ns, verify no events
         """
-        self.vapi.want_ip6_nd_events(enable_disable=0,
-                                     address=inet_pton(AF_INET6, "::0"))
+        self.vapi.want_ip6_nd_events(enable_disable=0, ip="::")
         dst_host = self.ip6_host(50, 50, "00:00:11:22:33:44")
         macs = self.mac_list(range(10, 15))
         hosts = self.ip6_hosts(5, 1, macs)