* [dts] [PATCH V1] update checksum test case
@ 2016-10-14 8:13 xu,huilong
2016-10-14 14:51 ` Liu, Yong
0 siblings, 1 reply; 2+ messages in thread
From: xu,huilong @ 2016-10-14 8:13 UTC (permalink / raw)
To: dts; +Cc: xu,huilong
csum function will not auto add outer ip src address already,
so update send packet src ip address
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] update checksum test case
2016-10-14 8:13 [dts] [PATCH V1] update checksum test case xu,huilong
@ 2016-10-14 14:51 ` Liu, Yong
0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2016-10-14 14:51 UTC (permalink / raw)
To: Xu, HuilongX, dts; +Cc: Xu, HuilongX
Thanks, applied.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong
> Sent: Friday, October 14, 2016 3:13 AM
> To: dts@dpdk.org
> Cc: Xu, HuilongX
> Subject: [dts] [PATCH V1] update checksum test case
>
> csum function will not auto add outer ip src address already,
> so update send packet src ip address
>
> Signed-off-by: xu,huilong <huilongx.xu@intel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-14 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 8:13 [dts] [PATCH V1] update checksum test case xu,huilong
2016-10-14 14:51 ` Liu, Yong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).