misc: fix icmp
[vpp.git] / test / test_map.py
index 16e9607..565f7da 100644 (file)
@@ -3,7 +3,8 @@
 import ipaddress
 import unittest
 
-from framework import VppTestCase, VppTestRunner
+from framework import VppTestCase
+from asfframework import VppTestRunner
 from vpp_ip import DpoProto
 from vpp_ip_route import VppIpRoute, VppRoutePath
 from util import fragment_rfc791, fragment_rfc8200
@@ -53,7 +54,12 @@ class TestMAP(VppTestCase):
 
     def tearDown(self):
         super(TestMAP, self).tearDown()
+
         for i in self.pg_interfaces:
+            for t in (0, 1):
+                self.vapi.map_if_enable_disable(
+                    is_enable=0, sw_if_index=i.sw_if_index, is_translation=t
+                )
             i.unconfig_ip4()
             i.unconfig_ip6()
             i.admin_down()
@@ -653,7 +659,7 @@ class TestMAP(VppTestCase):
         p4 = p_ether / ip4_ttl_expired / payload
 
         icmp4_reply = (
-            IP(id=0, ttl=254, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4)
+            IP(id=0, ttl=255, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4)
             / ICMP(type="time-exceeded", code="ttl-zero-during-transit")
             / IP(src=self.pg0.remote_ip4, dst="192.168.0.1", ttl=0)
             / payload
@@ -667,7 +673,7 @@ class TestMAP(VppTestCase):
         p4 = p_ether / ip4_ttl_expired / payload
 
         icmp4_reply = (
-            IP(id=0, ttl=254, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4)
+            IP(id=0, ttl=255, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4)
             / ICMP(type="time-exceeded", code="ttl-zero-during-transit")
             / IP(src=self.pg0.remote_ip4, dst="192.168.0.1", ttl=1)
             / payload