octeon: enable vf device promiscuous mode feature
[vpp.git] / test / test_mtu.py
index 922d83d..6735cc6 100644 (file)
 import unittest
 from scapy.layers.inet6 import IPv6, Ether, IP, UDP, ICMPv6PacketTooBig
 from scapy.layers.inet import ICMP
-from framework import VppTestCase, VppTestRunner
-from vpp_ip import DpoProto
-from vpp_ip_route import VppIpRoute, VppRoutePath, FibPathProto
-from socket import AF_INET, AF_INET6, inet_pton
+from framework import VppTestCase
+from asfframework import VppTestRunner
 from util import reassemble4
 
 
@@ -101,7 +99,7 @@ class TestMTU(VppTestCase):
             chksum=0x2DBB,
         )
         icmp4_reply = (
-            IP(src=self.pg0.local_ip4, dst=self.pg0.remote_ip4, ttl=254, len=576, id=0)
+            IP(src=self.pg0.local_ip4, dst=self.pg0.remote_ip4, ttl=255, len=576, id=0)
             / p_icmp4
             / p_ip4
             / p_payload
@@ -115,6 +113,8 @@ class TestMTU(VppTestCase):
             # n.show2()
             self.validate_bytes(bytes(p[1]), icmp4_reply)
 
+        self.assert_error_counter_equal("/err/ip4-input/mtu_exceeded", 11)
+
         # Now with DF off. Expect fragments.
         # First go with 1500 byte packets.
         p_payload = UDP(sport=1234, dport=1234) / self.payload(1500 - 20 - 8)
@@ -193,6 +193,8 @@ class TestMTU(VppTestCase):
         for p in rx:
             self.validate_bytes(bytes(p[1]), icmp6_reply_str)
 
+        self.assert_error_counter_equal("/err/ip6-input/mtu_exceeded", 9)
+
         # Reset MTU
         self.vapi.sw_interface_set_mtu(self.pg1.sw_if_index, [current_mtu, 0, 0, 0])