test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05
@ 2017-06-14  9:07 Lijuan Tu
  2017-06-14  9:07 ` [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample Lijuan Tu
  2017-07-14 12:31 ` [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 Liu, Yong
  0 siblings, 2 replies; 4+ messages in thread
From: Lijuan Tu @ 2017-06-14  9:07 UTC (permalink / raw)
  To: dts; +Cc: Lijuan Tu

1, dpdk remove vhost-net after dpdk17.02
2, tso add checksum check after dpdk16.1i1
3, add src-mac when send packets

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 tests/TestSuite_vxlan_sample.py | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/tests/TestSuite_vxlan_sample.py b/tests/TestSuite_vxlan_sample.py
index 1dbb727..752e0a7 100644
--- a/tests/TestSuite_vxlan_sample.py
+++ b/tests/TestSuite_vxlan_sample.py
@@ -75,15 +75,6 @@ class TestVxlanSample(TestCase):
         """
         Run before each test suite.
         """
-        # Change the config file to support vhost and recompile the package.
-        self.dut.send_expect("sed -i -e 's/RTE_LIBRTE_VHOST=n$/"
-                             + "RTE_LIBRTE_VHOST=y/' config/"
-                             + "common_base", "# ", 30)
-        # temporary disable skip_setup
-        skip_setup = self.dut.skip_setup
-        self.dut.skip_setup = False
-        self.dut.build_install_dpdk(self.target)
-        self.dut.skip_setup = skip_setup
 
         # this feature only enable in FVL now
         self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
@@ -106,15 +97,6 @@ class TestVxlanSample(TestCase):
         self.verify("Error" not in out, "compilation error 1")
         self.verify("No such file" not in out, "compilation error 2")
 
-        # build for vhost user environment
-        self.dut.send_expect("cd lib/librte_vhost/eventfd_link", "# ")
-        self.dut.send_expect("make", "# ")
-        self.dut.send_expect("insmod ./eventfd_link.ko", "# ")
-        self.dut.send_expect("cd ../../..", "# ")
-        out = self.dut.send_expect("lsmod |grep eventfd_link", "# ")
-        self.verify("eventfd_link" in out,
-                    "Failed to insmod eventfd_link driver")
-
         self.def_mac = "00:00:20:00:00:20"
         self.vm_dut = None
         self.tep_app = "./examples/tep_termination/build/tep_termination"
@@ -163,10 +145,11 @@ class TestVxlanSample(TestCase):
 
         encap = self.FEAT_ENABLE
         decap = self.FEAT_ENABLE
-        chksum = self.FEAT_DISABLE
+        chksum = self.FEAT_ENABLE
         if self.running_case == "test_vxlan_sample_encap":
             encap = self.FEAT_ENABLE
             decap = self.FEAT_DISABLE
+            chksum = self.FEAT_ENABLE
         elif self.running_case == "test_vxlan_sample_decap":
             encap = self.FEAT_DISABLE
             decap = self.FEAT_ENABLE
@@ -237,6 +220,8 @@ class TestVxlanSample(TestCase):
             self.vm.stop()
             self.vm = None
 
+        self.dut.virt_exit()
+
     def mac_address_add(self, number):
         if number > 15:
             return ''
@@ -302,6 +287,7 @@ class TestVxlanSample(TestCase):
         self.tester.session.copy_file_from(self.capture_file)
 
         if os.path.isfile('vxlan_cap.pcap'):
+            self.verify(os.path.getsize('vxlan_cap.pcap') != 0, "Packets receive error")
             pkts = rdpcap('vxlan_cap.pcap')
         else:
             pkts = []
@@ -312,12 +298,13 @@ class TestVxlanSample(TestCase):
         case_pass = True
         tester_recv_port = self.tester.get_local_port(self.pf)
         tester_iface = self.tester.get_interface(tester_recv_port)
+        tester_smac = self.tester.get_mac(tester_recv_port)
 
         if pkt_type == "normal_udp":
             self.start_capture(tester_iface, pkt_smac=self.pf_mac)
             self.tester.scapy_append(
-                'sendp([Ether(dst="%s")/IP()/UDP()/Raw("X"*18)], iface="%s")'
-                % (self.pf_mac, tester_iface))
+                'sendp([Ether(dst="%s",src="%s")/IP()/UDP()/Raw("X"*18)], iface="%s")'
+                % (self.pf_mac, tester_smac, tester_iface))
             self.tester.scapy_execute()
             time.sleep(5)
 
@@ -390,6 +377,7 @@ class TestVxlanSample(TestCase):
 
             # transfer capture pcap to server
             pkts = self.transfer_capture_file()
+
             # check packet number and payload
             self.verify(len(pkts) >= 1, "Failed to capture packets")
             self.verify(pkts[0].haslayer(Vxlan) == 1,
@@ -461,6 +449,7 @@ class TestVxlanSample(TestCase):
             mac_incr = 2 * vm_id + vf_id
             params['inner_mac_dst'] = self.mac_address_add(mac_incr)
             params['payload_size'] = 892  # 256 + 256 + 256 + 124
+
             # extract reference chksum value
             vxlan_pkt = VxlanTestConfig(self, **params)
             vxlan_pkt.create_pcap()
@@ -474,6 +463,25 @@ class TestVxlanSample(TestCase):
             pkts = self.transfer_capture_file()
             # check packet number and payload
             self.verify(len(pkts) == 4, "Failed to capture tso packets")
+
+            # calculation  checksum, and checkt it
+            for pkt in pkts:
+                inner = pkt[Vxlan]
+                inner_ip_chksum = inner[IP].chksum
+                del inner.chksum
+                inner[IP] = inner[IP].__class__(str(inner[IP]))
+                inner_ip_chksum_ref = inner[IP].chksum
+                print utils.GREEN("inner ip checksum reference: %x" % inner_ip_chksum_ref)
+                print utils.GREEN("inner ip checksum: %x" % inner_ip_chksum)
+                self.verify(inner_ip_chksum == inner_ip_chksum_ref, "inner ip checksum error")
+                inner_l4_chksum = inner[params['inner_l4_type']].chksum
+                del inner[params['inner_l4_type']].chksum
+                inner[params['inner_l4_type']] = inner[params['inner_l4_type']].__class__(str(inner[params['inner_l4_type']]))
+                inner_l4_chksum_ref =  inner[params['inner_l4_type']].chksum
+                print utils.GREEN("inner l4 checksum reference: %x" % inner_l4_chksum_ref)
+                print utils.GREEN("inner l4 checksum: %x" % inner_l4_chksum)
+                self.verify(inner_l4_chksum == inner_l4_chksum_ref, "inner %s checksum error" % params['inner_l4_type'])
+
             length = 0
             for pkt in pkts:
                 self.verify(pkt.haslayer(Vxlan) == 1,
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample.
  2017-06-14  9:07 [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 Lijuan Tu
@ 2017-06-14  9:07 ` Lijuan Tu
  2017-07-14 12:34   ` Liu, Yong
  2017-07-14 12:31 ` [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 Liu, Yong
  1 sibling, 1 reply; 4+ messages in thread
From: Lijuan Tu @ 2017-06-14  9:07 UTC (permalink / raw)
  To: dts; +Cc: Lijuan Tu

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 tests/TestSuite_vxlan.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py
index 411ce22..7d34cdd 100644
--- a/tests/TestSuite_vxlan.py
+++ b/tests/TestSuite_vxlan.py
@@ -24,7 +24,7 @@ from scapy.config import conf
 from scapy.route import *
 
 from test_case import TestCase
-from settings import HEADER_SIZE
+from settings import HEADER_SIZE, FOLDERS
 from etgen import IxiaPacketGenerator
 
 #
@@ -236,6 +236,11 @@ class VxlanTestConfig(object):
         """
         Send vxlan pcap file by iface
         """
+        # load vxlan module to scapy
+        cwd = os.getcwd()
+        dir_vxlan_module = cwd + r'/' + FOLDERS['Depends']
+        self.test_case.tester.scapy_append("sys.path.append('%s')" % dir_vxlan_module)
+        self.test_case.tester.scapy_append("from vxlan import Vxlan")
         self.test_case.tester.scapy_append(
             'pcap = rdpcap("%s")' % self.pcap_file)
         self.test_case.tester.scapy_append(
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05
  2017-06-14  9:07 [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 Lijuan Tu
  2017-06-14  9:07 ` [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample Lijuan Tu
@ 2017-07-14 12:31 ` Liu, Yong
  1 sibling, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2017-07-14 12:31 UTC (permalink / raw)
  To: Lijuan Tu, dts

Thanks, applied.

On 06/14/2017 05:07 PM, Lijuan Tu wrote:
> 1, dpdk remove vhost-net after dpdk17.02
> 2, tso add checksum check after dpdk16.1i1
> 3, add src-mac when send packets
>
> Signed-off-by: Lijuan Tu<lijuanx.a.tu@intel.com>
> ---

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample.
  2017-06-14  9:07 ` [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample Lijuan Tu
@ 2017-07-14 12:34   ` Liu, Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2017-07-14 12:34 UTC (permalink / raw)
  To: Lijuan Tu, dts

Applied, please take care with subject. It wasn't align with the content.

On 06/14/2017 05:07 PM, Lijuan Tu wrote:
> Signed-off-by: Lijuan Tu<lijuanx.a.tu@intel.com>
> ---
>   tests/TestSuite_vxlan.py | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-14  3:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14  9:07 [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 Lijuan Tu
2017-06-14  9:07 ` [dts] [PATCH V2 2/2] vxlan: snyc the vxlan_sample Lijuan Tu
2017-07-14 12:34   ` Liu, Yong
2017-07-14 12:31 ` [dts] [PATCH V2 1/2] vxlan_sample: adjust to dpdk17.05 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).