nat: use correct data types for memory sizes
[vpp.git] / test / test_p2p_ethernet.py
index 6719400..7cc6cdc 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import random
 import unittest
 import datetime
@@ -172,7 +172,7 @@ class P2PEthernetIPV6(VppTestCase):
             pkt_size = random.choice(self.pg_if_packet_sizes)
         p = Ether(src=src_mac, dst=dst_mac)
         p /= IPv6(src=src_ip, dst=dst_ip)
-        p /= (UDP(sport=1234, dport=4321) / Raw('\xa5' * 20))
+        p /= (UDP(sport=1234, dport=4321) / Raw(b'\xa5' * 20))
         self.extend_packet(p, pkt_size)
         return p
 
@@ -192,16 +192,14 @@ class P2PEthernetIPV6(VppTestCase):
 
         route_8000 = VppIpRoute(self, "8000::", 64,
                                 [VppRoutePath(self.pg0.remote_ip6,
-                                              self.pg0.sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                              self.pg0.sw_if_index)])
         route_8000.add_vpp_config()
 
         self.packets = [(Ether(dst=self.pg1.local_mac,
                                src=self.pg1.remote_mac) /
                          IPv6(src="3001::1", dst="8000::100") /
                          UDP(sport=1234, dport=1234) /
-                         Raw('\xa5' * 100))]
+                         Raw(b'\xa5' * 100))]
         self.send_packets(self.pg1, self.pg0)
 
         self.logger.info("FFP_TEST_FINISH_0001")
@@ -212,9 +210,7 @@ class P2PEthernetIPV6(VppTestCase):
 
         route_9001 = VppIpRoute(self, "9001::", 64,
                                 [VppRoutePath(self.pg1.remote_ip6,
-                                              self.pg1.sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                              self.pg1.sw_if_index)])
         route_9001.add_vpp_config()
 
         self.packets.append(
@@ -237,9 +233,7 @@ class P2PEthernetIPV6(VppTestCase):
 
         route_3 = VppIpRoute(self, "9000::", 64,
                              [VppRoutePath(self.pg1._remote_hosts[0].ip6,
-                                           self.pg1.sw_if_index,
-                                           proto=DpoProto.DPO_PROTO_IP6)],
-                             is_ip6=1)
+                                           self.pg1.sw_if_index)])
         route_3.add_vpp_config()
 
         self.packets.append(
@@ -262,9 +256,7 @@ class P2PEthernetIPV6(VppTestCase):
 
         route_9001 = VppIpRoute(self, "9000::", 64,
                                 [VppRoutePath(self.pg1._remote_hosts[0].ip6,
-                                              self.pg1.sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                              self.pg1.sw_if_index)])
         route_9001.add_vpp_config()
 
         self.packets.append(
@@ -283,21 +275,17 @@ class P2PEthernetIPV6(VppTestCase):
 
         route_8000 = VppIpRoute(self, "8000::", 64,
                                 [VppRoutePath(self.pg0.remote_ip6,
-                                              self.pg0.sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                              self.pg0.sw_if_index)])
         route_8000.add_vpp_config()
         route_8001 = VppIpRoute(self, "8001::", 64,
-                                [VppRoutePath(self.p2p_sub_ifs[0].remote_ip6,
-                                              self.p2p_sub_ifs[0].sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                [VppRoutePath(
+                                    self.p2p_sub_ifs[0].remote_ip6,
+                                    self.p2p_sub_ifs[0].sw_if_index)])
         route_8001.add_vpp_config()
         route_8002 = VppIpRoute(self, "8002::", 64,
-                                [VppRoutePath(self.p2p_sub_ifs[1].remote_ip6,
-                                              self.p2p_sub_ifs[1].sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                [VppRoutePath(
+                                    self.p2p_sub_ifs[1].remote_ip6,
+                                    self.p2p_sub_ifs[1].sw_if_index)])
         route_8002.add_vpp_config()
 
         for i in range(0, 3):
@@ -387,7 +375,7 @@ class P2PEthernetIPV4(VppTestCase):
             pkt_size = random.choice(self.pg_if_packet_sizes)
         p = Ether(src=src_mac, dst=dst_mac)
         p /= IP(src=src_ip, dst=dst_ip)
-        p /= (UDP(sport=1234, dport=4321) / Raw('\xa5' * 20))
+        p /= (UDP(sport=1234, dport=4321) / Raw(b'\xa5' * 20))
         self.extend_packet(p, pkt_size)
         return p