From 6fb0d9b269057a40b6979c741f8c1187b653d12d Mon Sep 17 00:00:00 2001 From: Hongjun Ni Date: Fri, 8 Jun 2018 07:12:05 +0800 Subject: L3DSR fix ip checksum issue and add test Change-Id: Iedebbac71d3e694b915d6a126c80ecc3b5473a4a Signed-off-by: Hongjun Ni --- test/test_lb.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/test_lb.py b/test/test_lb.py index 79a95988671..d2e7185cf3f 100644 --- a/test/test_lb.py +++ b/test/test_lb.py @@ -4,6 +4,7 @@ from scapy.layers.inet import IP, UDP from scapy.layers.inet6 import IPv6 from scapy.layers.l2 import Ether, GRE from scapy.packet import Raw +from scapy.data import IP_PROTOS from framework import VppTestCase from util import ppp @@ -145,6 +146,11 @@ class TestLB(VppTestCase): self.assertEqual(ip.dst, "10.0.0.%u" % asid) self.assertEqual(ip.tos, 0x1c) self.assertEqual(len(ip.options), 0) + self.assert_ip_checksum_valid(p) + if ip.proto == IP_PROTOS.tcp: + self.assert_tcp_checksum_valid(p) + elif ip.proto == IP_PROTOS.udp: + self.assert_udp_checksum_valid(p) elif (encap == 'nat4'): ip = p[IP] asid = int(ip.dst.split(".")[3]) -- cgit 1.2.3-korg