From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 95522F94 for ; Fri, 14 Oct 2016 10:11:40 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 14 Oct 2016 01:11:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,491,1473145200"; d="scan'208";a="1064699259" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 14 Oct 2016 01:11:38 -0700 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Fri, 14 Oct 2016 16:13:10 +0800 Message-Id: <1476432790-4124-1-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] update checksum test case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 08:11:41 -0000 csum function will not auto add outer ip src address already, so update send packet src ip address Signed-off-by: xu,huilong --- tests/TestSuite_checksum_offload.py | 24 ++++++++++++------------ tests/TestSuite_nvgre.py | 12 ++++++------ tests/TestSuite_vxlan.py | 12 ++++++------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py index 57069f0..18e3848 100644 --- a/tests/TestSuite_checksum_offload.py +++ b/tests/TestSuite_checksum_offload.py @@ -162,11 +162,11 @@ class TestChecksumOffload(TestCase): 'IPv6/UDP': 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46)' % mac, 'IPv6/TCP': 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)' % mac} - pkts = {'IP/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.2")/UDP()/("X"*46)' % mac, - 'IP/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.2")/TCP()/("X"*46)' % mac, - 'IP/SCTP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.2")/SCTP()/("X"*48)' % mac, - 'IPv6/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IPv6(src="::2")/UDP()/("X"*46)' % mac, - 'IPv6/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IPv6(src="::2")/TCP()/("X"*46)' % mac} + pkts = {'IP/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.1")/UDP()/("X"*46)' % mac, + 'IP/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.1")/TCP()/("X"*46)' % mac, + 'IP/SCTP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IP(src="127.0.0.1")/SCTP()/("X"*48)' % mac, + 'IPv6/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IPv6(src="::1")/UDP()/("X"*46)' % mac, + 'IPv6/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/Dot1Q(vlan=1)/IPv6(src="::1")/TCP()/("X"*46)' % mac} if self.kdriver == "fm10k": del pktsChkErr['IP/SCTP'] @@ -193,11 +193,11 @@ class TestChecksumOffload(TestCase): 'IPv6/UDP': 'Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46)' % mac, 'IPv6/TCP': 'Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)' % mac} - pkts_ref = {'IP/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.2")/UDP()/("X"*46)' % mac, - 'IP/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.2")/TCP()/("X"*46)' % mac, - 'IP/SCTP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.2")/SCTP()/("X"*48)' % mac, - 'IPv6/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IPv6(src="::2")/UDP()/("X"*46)' % mac, - 'IPv6/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IPv6(src="::2")/TCP()/("X"*46)' % mac} + pkts_ref = {'IP/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.1")/UDP()/("X"*46)' % mac, + 'IP/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.1")/TCP()/("X"*46)' % mac, + 'IP/SCTP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="127.0.0.1")/SCTP()/("X"*48)' % mac, + 'IPv6/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IPv6(src="::1")/UDP()/("X"*46)' % mac, + 'IPv6/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IPv6(src="::1")/TCP()/("X"*46)' % mac} if self.kdriver == "fm10k": del pkts['IP/SCTP'] @@ -228,8 +228,8 @@ class TestChecksumOffload(TestCase): 'IPv6/UDP': 'Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="%s")/UDP(chksum=0xf)/("X"*46)' % (mac, sndIPv6), 'IPv6/TCP': 'Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="%s")/TCP(chksum=0xf)/("X"*46)' % (mac, sndIPv6)} - expIP = "10.0.0.2" - expIPv6 = '::2' + expIP = sendIP + expIPv6 = sendIPv6 expPkts = {'IP/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="%s")/UDP()/("X"*46)' % (mac, expIP), 'IP/TCP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IP(src="%s")/TCP()/("X"*46)' % (mac, expIP), 'IPv6/UDP': 'Ether(dst="02:00:00:00:00:00", src="%s")/IPv6(src="%s")/UDP()/("X"*46)' % (mac, expIPv6), diff --git a/tests/TestSuite_nvgre.py b/tests/TestSuite_nvgre.py index 75f5263..c1df309 100644 --- a/tests/TestSuite_nvgre.py +++ b/tests/TestSuite_nvgre.py @@ -525,17 +525,17 @@ class TestNvgre(TestCase): config = NvgreTestConfig(self, **args) # now cloud filter will default enable L2 mac filter, so dst mac must be same config.outer_mac_dst = self.dut_rx_port_mac - # csum function will change outer ipv src address + # csum function will not change outer ipv src address already if config.outer_ip6_src != "N/A": - config.outer_ip6_src = IncreaseIPv6(config.outer_ip6_src) + config.outer_ip6_src = config.outer_ip6_src else: - config.outer_ip_src = IncreaseIP(config.outer_ip_src) + config.outer_ip_src = config.outer_ip_src - # csum function will auto change nvgre inner ipv src address + # csum function will not auto change nvgre inner ipv src address already if config.inner_ip6_src != "N/A": - config.inner_ip6_src = IncreaseIPv6(config.inner_ip6_src) + config.inner_ip6_src = config.inner_ip6_src else: - config.inner_ip_src = IncreaseIP(config.inner_ip_src) + config.inner_ip_src = config.inner_ip_src # create abnormal package with wrong checksum config.create_pcap() diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py index 03c47d8..b810c13 100644 --- a/tests/TestSuite_vxlan.py +++ b/tests/TestSuite_vxlan.py @@ -409,18 +409,18 @@ class TestVxlan(TestCase, IxiaPacketGenerator): # now cloud filter will default enable L2 mac filter, so dst mac must # be same config.outer_mac_dst = self.dut_port_mac - # csum function will auto add outer ipv src address + # csum function will not auto add outer ip src address already, so update send packet src ip address if config.outer_ip6_src != "N/A": - config.outer_ip6_src = IncreaseIPv6(config.outer_ip6_src) + config.outer_ip6_src = config.outer_ip6_src else: - config.outer_ip_src = IncreaseIP(config.outer_ip_src) + config.outer_ip_src = config.outer_ip_src - # csum function will auto add vxlan inner ipv src address + # csum function will not auto add outer ip src address already, so update send packet src ip address if config.outer_udp_dst == VXLAN_PORT: if config.inner_ip6_src != "N/A": - config.inner_ip6_src = IncreaseIPv6(config.inner_ip6_src) + config.inner_ip6_src = config.inner_ip6_src else: - config.inner_ip_src = IncreaseIP(config.inner_ip_src) + config.inner_ip_src = config.inner_ip_src # extract the checksum value of vxlan packet config.create_pcap() -- 1.9.3