X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ip4.py;h=6d6aeb0a5d9802cd48108e5d05a08e895c5bed01;hb=68577d2982a345537e300e99a8c0e0311fe08ce1;hp=346904ab9816a24d9ad9e49560b499d52be3c396;hpb=df3ca23f17820389fc625bbc0e7f468fce550aa9;p=vpp.git diff --git a/test/test_ip4.py b/test/test_ip4.py index 346904ab981..6d6aeb0a5d9 100644 --- a/test/test_ip4.py +++ b/test/test_ip4.py @@ -17,6 +17,7 @@ from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpMRoute, \ VppMRoutePath, MRouteItfFlags, MRouteEntryFlags, VppMplsIpBind, \ VppMplsTable, VppIpTable from vpp_sub_interface import VppSubInterface, VppDot1QSubint, VppDot1ADSubint +from vpp_papi import VppEnum NUM_PKTS = 67 @@ -1281,10 +1282,28 @@ class TestIPPunt(VppTestCase): def test_ip_punt(self): """ IP punt police and redirect """ + # use UDP packet that have a port we need to explicitly + # register to get punted. + pt_l4 = VppEnum.vl_api_punt_type_t.PUNT_API_TYPE_L4 + af_ip4 = VppEnum.vl_api_address_family_t.ADDRESS_IP4 + udp_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP + punt_udp = { + 'type': pt_l4, + 'punt': { + 'l4': { + 'af': af_ip4, + 'protocol': udp_proto, + 'port': 1234, + } + } + } + + self.vapi.set_punt(is_add=1, punt=punt_udp) + p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) / - TCP(sport=1234, dport=1234) / + UDP(sport=1234, dport=1234) / Raw('\xa5' * 100)) pkts = p * 1025