X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_mtu.py;h=3c938a8cdcec659266fad9d28076403aa2e24e7f;hb=61717cc38;hp=14535b23e2132453b6ceffbc3e8008d7b6f2967f;hpb=7f9b7f9f492d1748d8ba025b3a713058fdb1943d;p=vpp.git diff --git a/test/test_mtu.py b/test/test_mtu.py index 14535b23e21..3c938a8cdce 100644 --- a/test/test_mtu.py +++ b/test/test_mtu.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """IP4 and IP6 MTU functional tests""" # @@ -13,7 +13,7 @@ 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 +from vpp_ip_route import VppIpRoute, VppRoutePath, FibPathProto from socket import AF_INET, AF_INET6, inet_pton from util import reassemble4 @@ -65,7 +65,7 @@ class TestMTU(VppTestCase): return 'x' * len def get_mtu(self, sw_if_index): - rv = self.vapi.sw_interface_dump() + rv = self.vapi.sw_interface_dump(sw_if_index=sw_if_index) for i in rv: if i.sw_if_index == sw_if_index: return i.mtu[0] @@ -101,7 +101,6 @@ class TestMTU(VppTestCase): dst=self.pg0.remote_ip4, ttl=254, len=576, id=0) / p_icmp4 / p_ip4 / p_payload) - icmp4_reply[1].ttl -= 1 n = icmp4_reply.__class__(icmp4_reply) s = bytes(icmp4_reply) icmp4_reply = s[0:576] @@ -118,7 +117,7 @@ class TestMTU(VppTestCase): p4 = p_ether / p_ip4 / p_payload p4.flags = 0 p4_reply = p_ip4 / p_payload - p4_reply.ttl = 62 # check this + p4_reply.ttl = p_ip4.ttl - 1 p4_reply.flags = 0 p4_reply.id = 256 self.pg_enable_capture()