X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_vxlan_gbp.py;h=f332aced7d8cdf205d5cf92da2ae37a974577ae2;hb=698eb87a8eed847fe555ef327bcc99a4467ed59a;hp=17ee66205b61c12046d28a0bb3ab524ec25bb9a6;hpb=efd7bc2b1c8db160933ed3e9ab3cde0d07aaf863;p=vpp.git diff --git a/test/test_vxlan_gbp.py b/test/test_vxlan_gbp.py index 17ee66205b6..f332aced7d8 100644 --- a/test/test_vxlan_gbp.py +++ b/test/test_vxlan_gbp.py @@ -6,10 +6,11 @@ import unittest from framework import VppTestCase, VppTestRunner from template_bd import BridgeDomain -from scapy.layers.l2 import Ether, Raw +from scapy.layers.l2 import Ether +from scapy.packet import Raw from scapy.layers.inet import IP, UDP from scapy.layers.vxlan import VXLAN -from scapy.utils import atol + from vpp_ip_route import VppIpRoute, VppRoutePath from vpp_ip import INVALID_INDEX @@ -79,7 +80,8 @@ class TestVxlanGbp(VppTestCase): # Verify UDP destination port is VXLAN GBP 48879, source UDP port could # be arbitrary. self.assertEqual(pkt[UDP].dport, type(self).dport) - # TODO: checksum check + # Verify UDP checksum + self.assert_udp_checksum_valid(pkt) # Verify VNI # pkt.show() self.assertEqual(pkt[VXLAN].vni, vni) @@ -95,7 +97,7 @@ class TestVxlanGbp(VppTestCase): for dest_ip4 in ip4_range(cls.pg0.remote_ip4, ip_range_start, ip_range_end): - # add host route so dest_ip4n will not be resolved + # add host route so dest_ip4 will not be resolved rip = VppIpRoute(cls, dest_ip4, 32, [VppRoutePath(next_hop_address, INVALID_INDEX)], @@ -144,11 +146,12 @@ class TestVxlanGbp(VppTestCase): # Create VXLAN GBP VTEP on VPP pg0, and put vxlan_gbp_tunnel0 and # pg1 into BD. cls.single_tunnel_bd = 1 + cls.single_tunnel_vni = 0xabcde r = cls.vapi.vxlan_gbp_tunnel_add_del( tunnel={ 'src': cls.pg0.local_ip4, 'dst': cls.pg0.remote_ip4, - 'vni': cls.single_tunnel_bd, + 'vni': cls.single_tunnel_vni, 'instance': INVALID_INDEX, 'mcast_sw_if_index': INVALID_INDEX, 'mode': 1, @@ -196,7 +199,7 @@ class TestVxlanGbp(VppTestCase): Verify receipt of decapsulated frames on pg1 """ encapsulated_pkt = self.encapsulate(self.frame_request, - self.single_tunnel_bd) + self.single_tunnel_vni) self.pg0.add_stream([encapsulated_pkt, ]) @@ -224,7 +227,7 @@ class TestVxlanGbp(VppTestCase): # Pick first received frame and check if it's correctly encapsulated. out = self.pg0.get_capture(1) pkt = out[0] - self.check_encapsulation(pkt, self.single_tunnel_bd) + self.check_encapsulation(pkt, self.single_tunnel_vni) payload = self.decapsulate(pkt) self.assert_eq_pkts(payload, self.frame_reply) @@ -268,7 +271,7 @@ class TestVxlanGbp(VppTestCase): # Pick first received frame and check if it's correctly encapsulated. out = self.pg0.get_capture(2) pkt = reassemble4_ether(out) - self.check_encapsulation(pkt, self.single_tunnel_bd) + self.check_encapsulation(pkt, self.single_tunnel_vni) payload = self.decapsulate(pkt) self.assert_eq_pkts(payload, frame)