test suite reviews and discussions
 help / color / mirror / Atom feed
From: wenjieli <wenjiex.a.li@intel.com>
To: dts@dpdk.org
Cc: wenjieli <wenjiex.a.li@intel.com>
Subject: [dts] [PATCH V2] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not
Date: Tue, 23 Oct 2018 13:14:12 +0800	[thread overview]
Message-ID: <1540271652-4683-1-git-send-email-wenjiex.a.li@intel.com> (raw)

If crc strip enabled, the crc strip bit (bit 12) is 0, else it is 1.
Use this bit to check crc is enabled or not, will not just check the Rx
offloads value in output.

Signed-off-by: wenjieli <wenjiex.a.li@intel.com>
---
 tests/TestSuite_shutdown_api.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 52a8fbf..decd9a7 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -263,6 +263,8 @@ class TestShutdownApi(TestCase):
         """
         Reconfigure All Ports With The Same Configurations (CRC)
         """
+        RX_OFFLOAD_KEEP_CRC = 0x1000
+        CRC_Strip_bit = 0
         self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket)
         out = self.dut.send_expect("show config rxtx", "testpmd> ")
         self.verify(
@@ -273,8 +275,10 @@ class TestShutdownApi(TestCase):
         self.dut.send_expect("set fwd mac", "testpmd>")
         self.dut.send_expect("port start all", "testpmd> ", 100)
         out = self.dut.send_expect("show config rxtx", "testpmd> ")
+        Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
         self.verify(
-            "Rx offloads=0x1000" in out, "CRC stripping not enabled properly")
+            RX_OFFLOAD_KEEP_CRC & int(Rx_offloads[0],16) == CRC_Strip_bit and RX_OFFLOAD_KEEP_CRC & int(Rx_offloads[1],16) == CRC_Strip_bit,
+            "CRC stripping not enabled properly")
         self.dut.send_expect("start", "testpmd> ")
         self.check_forwarding()
 
-- 
2.17.2

                 reply	other threads:[~2018-10-23  5:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1540271652-4683-1-git-send-email-wenjiex.a.li@intel.com \
    --to=wenjiex.a.li@intel.com \
    --cc=dts@dpdk.org \
    /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).