VPP-1508: Tests: Fix vpp_api struct.error under py3.
[vpp.git] / test / test_ip6.py
index 111a71e..2f330c5 100644 (file)
@@ -4,6 +4,7 @@ import socket
 import unittest
 
 from parameterized import parameterized
+import scapy.compat
 import scapy.layers.inet6 as inet6
 from scapy.contrib.mpls import MPLS
 from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6ND_RS, \
@@ -318,7 +319,7 @@ class TestIPv6(TestIPv6ND):
             try:
                 ip = packet[IPv6]
                 udp = packet[inet6.UDP]
-                payload_info = self.payload_to_info(str(packet[Raw]))
+                payload_info = self.payload_to_info(packet[Raw])
                 packet_index = payload_info.index
                 self.assertEqual(payload_info.dst, dst_sw_if_index)
                 self.logger.debug(
@@ -971,7 +972,7 @@ class TestICMPv6Echo(VppTestCase):
 
         icmpv6_id = 0xb
         icmpv6_seq = 5
-        icmpv6_data = '\x0a' * 18
+        icmpv6_data = b'\x0a' * 18
         p_echo_request = (Ether(src=self.pg0.remote_mac,
                                 dst=self.pg0.local_mac) /
                           IPv6(src=self.pg0.remote_ip6,
@@ -1950,7 +1951,7 @@ class TestIP6Punt(VppTestCase):
         #
         # add a policer
         #
-        policer = self.vapi.policer_add_del("ip6-punt", 400, 0, 10, 0,
+        policer = self.vapi.policer_add_del(b"ip6-punt", 400, 0, 10, 0,
                                             rate_type=1)
         self.vapi.ip_punt_police(policer.policer_index, is_ip6=1)
 
@@ -1971,7 +1972,7 @@ class TestIP6Punt(VppTestCase):
         # remove the policer. back to full rx
         #
         self.vapi.ip_punt_police(policer.policer_index, is_add=0, is_ip6=1)
-        self.vapi.policer_add_del("ip6-punt", 400, 0, 10, 0,
+        self.vapi.policer_add_del(b"ip6-punt", 400, 0, 10, 0,
                                   rate_type=1, is_add=0)
         self.send_and_expect(self.pg0, pkts, self.pg1)