Fix multiple NAT translation with interface address as external
[vpp.git] / test / test_map.py
index 9ac3948..c5e193a 100644 (file)
@@ -4,7 +4,7 @@ import unittest
 import socket
 
 from framework import VppTestCase, VppTestRunner
-from vpp_ip_route import VppIpRoute, VppRoutePath
+from vpp_ip_route import VppIpRoute, VppRoutePath, DpoProto
 
 from scapy.layers.l2 import Ether, Raw
 from scapy.layers.inet import IP, UDP, ICMP
@@ -38,13 +38,6 @@ class TestMAP(VppTestCase):
             i.unconfig_ip6()
             i.admin_down()
 
-    def send_and_assert_no_replies(self, intf, pkts, remark):
-        intf.add_stream(pkts)
-        self.pg_enable_capture(self.pg_interfaces)
-        self.pg_start()
-        for i in self.pg_interfaces:
-            i.assert_nothing_captured(remark=remark)
-
     def send_and_assert_encapped(self, tx, ip6_src, ip6_dst, dmac=None):
         if not dmac:
             dmac = self.pg1.remote_mac
@@ -75,7 +68,7 @@ class TestMAP(VppTestCase):
                                map_br_pfx_len,
                                [VppRoutePath(self.pg1.remote_ip6,
                                              self.pg1.sw_if_index,
-                                             is_ip6=1)],
+                                             proto=DpoProto.DPO_PROTO_IP6)],
                                is_ip6=1)
         map_route.add_vpp_config()
 
@@ -138,13 +131,12 @@ class TestMAP(VppTestCase):
         # Add a route to 4001::1. Expect the encapped traffic to be
         # sent via that routes next-hop
         #
-        pre_res_route = VppIpRoute(self,
-                                   "4001::1",
-                                   128,
-                                   [VppRoutePath(self.pg1.remote_hosts[2].ip6,
-                                                 self.pg1.sw_if_index,
-                                                 is_ip6=1)],
-                                   is_ip6=1)
+        pre_res_route = VppIpRoute(
+            self, "4001::1", 128,
+            [VppRoutePath(self.pg1.remote_hosts[2].ip6,
+                          self.pg1.sw_if_index,
+                          proto=DpoProto.DPO_PROTO_IP6)],
+            is_ip6=1)
         pre_res_route.add_vpp_config()
 
         self.send_and_assert_encapped(v4, map_src,
@@ -156,7 +148,7 @@ class TestMAP(VppTestCase):
         #
         pre_res_route.modify([VppRoutePath(self.pg1.remote_hosts[3].ip6,
                                            self.pg1.sw_if_index,
-                                           is_ip6=1)])
+                                           proto=DpoProto.DPO_PROTO_IP6)])
         pre_res_route.add_vpp_config()
 
         self.send_and_assert_encapped(v4, map_src,