ip: Router ID included in flow hash
[vpp.git] / test / test_p2p_ethernet.py
index 6719400..fb55a36 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
 
@@ -190,20 +190,20 @@ class P2PEthernetIPV6(VppTestCase):
         """standard routing without p2p subinterfaces"""
         self.logger.info("FFP_TEST_START_0001")
 
+        self.pg0.config_ip6()
         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.pg0.unconfig_ip6()
         self.logger.info("FFP_TEST_FINISH_0001")
 
     def test_ip6_rx_p2p_subif(self):
@@ -212,9 +212,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 +235,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 +258,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(
@@ -281,23 +275,21 @@ class P2PEthernetIPV6(VppTestCase):
         """send packet via p2p subinterface"""
         self.logger.info("FFP_TEST_START_0005")
 
+        self.pg0.config_ip6()
+
         route_8000 = VppIpRoute(self, "8000::", 64,
-                                [VppRoutePath(self.pg0.remote_ip6,
-                                              self.pg0.sw_if_index,
-                                              proto=DpoProto.DPO_PROTO_IP6)],
-                                is_ip6=1)
+                                [VppRoutePath(self.pg0.remote_hosts[0].ip6,
+                                              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):
@@ -313,6 +305,7 @@ class P2PEthernetIPV6(VppTestCase):
         route_8001.remove_vpp_config()
         route_8002.remove_vpp_config()
 
+        self.pg0.unconfig_ip6()
         self.logger.info("FFP_TEST_FINISH_0005")
 
     def test_ip6_tx_p2p_subif_drop(self):
@@ -387,7 +380,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