test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ke Xu <ke1.xu@intel.com>
To: dts@dpdk.org
Cc: qi.fu@intel.com, weiyuanx.li@intel.com, lijuan.tu@intel.com,
	ke1.xu@intel.com
Subject: [DTS][PATCH V2 3/5] tests/vf_offload: Use modified checksum_validate to replace checksum_validate_tunnel.
Date: Wed, 28 Dec 2022 13:08:48 +0800	[thread overview]
Message-ID: <20221228050850.33004-4-ke1.xu@intel.com> (raw)
In-Reply-To: <20221228050850.33004-1-ke1.xu@intel.com>

Use checksum_validate method to validate and remove the tunnel one. The
 checksum_validate is updated to cover tunnel packet validation, the
 checksum_validate_tunnel is no longer necessary.

Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
 tests/TestSuite_vf_offload.py | 62 ++---------------------------------
 1 file changed, 3 insertions(+), 59 deletions(-)

diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py
index 42af482f..bccffb3d 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -394,64 +394,6 @@ class TestVfOffload(TestCase):
 
         self.verify(len(result) == 0, ",".join(list(result.values())))
 
-    def checksum_validate_tunnel(self, packets_sent, packets_expected):
-        """
-        Validate the checksum.
-        """
-        tx_interface = self.tester.get_interface(
-            self.tester.get_local_port(self.dut_ports[0])
-        )
-        rx_interface = self.tester.get_interface(
-            self.tester.get_local_port(self.dut_ports[1])
-        )
-        sniff_src = self.vm0_testpmd.get_port_mac(0)
-        checksum_pattern = re.compile("chksum.*=.*(0x[0-9a-z]+)")
-        sniff_src = "52:00:00:00:00:00"
-        chksum = dict()
-        # self.tester.send_expect("scapy", ">>> ")
-
-        for packet_type in list(packets_expected.keys()):
-            self.tester.send_expect("scapy", ">>> ")
-            self.tester.send_expect("p = %s" % packets_expected[packet_type], ">>>")
-            out = self.tester.send_expect("p.show2()", ">>>")
-            chksums = checksum_pattern.findall(out)
-            expected_chksum = chksums
-            chksum[packet_type] = chksums
-            print(packet_type, ": ", chksums)
-
-            self.tester.send_expect("exit()", "#")
-
-            self.tester.scapy_background()
-            inst = self.tester.tcpdump_sniff_packets(
-                intf=rx_interface,
-                count=len(packets_sent),
-                filters=[{"layer": "ether", "config": {"src": sniff_src}}],
-            )
-
-            # Send packet.
-            self.tester.scapy_foreground()
-
-            self.tester.scapy_append(
-                'sendp([%s], iface="%s")' % (packets_sent[packet_type], tx_interface)
-            )
-            self.tester.scapy_execute()
-            out = self.tester.scapy_get_result()
-            p = self.tester.load_tcpdump_sniff_packets(inst)
-            nr_packets = len(p)
-            print(p)
-            chksums = checksum_pattern.findall(p[0].show2(dump=True))
-            packets_received = chksums
-            self.logger.debug(f"packets_received: {packets_received}")
-            self.logger.debug(f"expected_chksum: {expected_chksum}")
-            self.verify(
-                len(expected_chksum) == len(packets_received),
-                f"The chksum type {packet_type} length of the actual result is inconsistent with the expected length!",
-            )
-            self.verify(
-                packets_received == expected_chksum,
-                f"The actually received chksum {packet_type} is inconsistent with the expectation",
-            )
-
     @check_supported_nic(
         ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"]
     )
@@ -570,7 +512,7 @@ class TestVfOffload(TestCase):
         self.vm0_testpmd.execute_cmd("start")
         self.vm0_testpmd.wait_link_status_up(0)
         self.vm0_testpmd.wait_link_status_up(1)
-        self.checksum_validate_tunnel(pkts, pkts_ref)
+        result = self.checksum_validate(pkts, pkts_ref)
         # Validate checksum on the receive packet
         out = self.vm0_testpmd.execute_cmd("stop")
         bad_outer_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-outer-ipcsum:", out)
@@ -588,6 +530,8 @@ class TestVfOffload(TestCase):
             self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error")
             self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error")
 
+        self.verify(len(result) == 0, ",".join(list(result.values())))
+
     def test_checksum_offload_disable(self):
         """
         Enable SW checksum offload.
-- 
2.25.1


  parent reply	other threads:[~2022-12-28  5:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28  5:08 [DTS][PATCH V2 0/5] Improve checksum validate and tso packet counting Ke Xu
2022-12-28  5:08 ` [DTS][PATCH V2 1/5] tests/vf_offload: Improve checksum_validate method Ke Xu
2022-12-28  5:08 ` [DTS][PATCH V2 2/5] tests/vf_offload: Remove redundant variable used Ke Xu
2022-12-28  5:08 ` Ke Xu [this message]
2022-12-28  5:08 ` [DTS][PATCH V2 4/5] tests/vf_offload: Improve tcpdump_analyse_sniff method Ke Xu
2022-12-28  5:08 ` [DTS][PATCH V2 5/5] tests/vf_offload: Replace the tcpdump implementation to a packet reading implementation Ke Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221228050850.33004-4-ke1.xu@intel.com \
    --to=ke1.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --cc=qi.fu@intel.com \
    --cc=weiyuanx.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).