test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yaqi Tang <yaqi.tang@intel.com>
To: ohilyard@iol.unh.edu
Cc: dts@dpdk.org, xueqin.lin@intel.com, Yaqi Tang <yaqi.tang@intel.com>
Subject: [dts][PATCH V1 2/2] tests/eeprom_dump: modify testsuite for columbiaville nic
Date: Tue, 22 Mar 2022 23:05:23 +0800	[thread overview]
Message-ID: <20220322150523.845757-3-yaqi.tang@intel.com> (raw)
In-Reply-To: <20220322150523.845757-1-yaqi.tang@intel.com>

If nic is columbiaville, eeprom_dump compare the output of the first 1000 lines from testpmd and ethtool,
module_eeprom_dump compare the output of the first 16 lines from testpmd and ethtool.

Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>
---
 tests/TestSuite_eeprom_dump.py | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/tests/TestSuite_eeprom_dump.py b/tests/TestSuite_eeprom_dump.py
index 236609e0..dc665219 100644
--- a/tests/TestSuite_eeprom_dump.py
+++ b/tests/TestSuite_eeprom_dump.py
@@ -34,6 +34,7 @@
 DPDK Test suite.
 """
 import re
+import time
 
 import framework.utils as utils
 from framework.pmd_output import PmdOutput
@@ -69,18 +70,35 @@ class TestEEPROMDump(TestCase):
 
         self.verify(not result, "Testpmd dumped is not same as linux dumped")
 
-    def dump_to_file(self, regex, get, to):
+    def dump_to_file(self, regex, get, to, testname):
+        # if nic is columbiaville, eeprom_dump get testpmd output of the first 1000 lines,
+        # module_eeprom_dump get testpmd output of the first 16 lines.
+        if self.nic in ["columbiaville_25g", "columbiaville_100g"]:
+            if  testname == "eeprom":
+                count = 1000
+            elif testname == "module_eeprom":
+                count = 16
+            n=0
+            # Get testpmd output to have only hex value
+            for line in re.findall(regex, get):
+                n= n+1
+                if n <= count:
+                    line = line.replace(" ", "").lower()
+                    self.dut.send_expect(f"echo {line} >> {to}", "#")
+
         # Get testpmd output to have only hex value
-        for line in re.findall(regex, get):
-            line = line.replace(" ", "").lower()
-            self.dut.send_expect(f"echo {line} >> {to}", "#")
+        else:
+            for line in re.findall(regex, get):
+                line = line.replace(" ", "").lower()
+                self.dut.send_expect(f"echo {line} >> {to}", "#")
 
     def check_output(self, testname, ethcommand):
         self.pmdout.start_testpmd("Default")
         portsinfo = []
 
         for port in self.ports:
-            pmdout = self.dut.send_expect(f"show port {port} {testname}", "testpmd>")
+            # show port {port} eeprom has 10485760 bytes, and it takes about 13 minutes to show finish.
+            pmdout = self.dut.send_expect(f"show port {port} {testname}", "testpmd>", timeout=800)
             self.verify("Finish --" in pmdout, f"{testname} dump failed")
 
             # get length from testpmd outout
@@ -112,6 +130,7 @@ class TestEEPROMDump(TestCase):
                 r"(?<=: )(.*)(?= \| )",
                 portinfo["pmdout"],
                 f"testpmd_{testname}_{port}.txt",
+                testname,
             )
 
             self.dut.send_expect(
@@ -127,9 +146,10 @@ class TestEEPROMDump(TestCase):
             )
 
             self.dump_to_file(
-                r"(?<=: )(.*)(?=  )",
+                r"(?<=: )(.*?)(?=  )",
                 portinfo["ethout"],
                 f"ethtool_{testname}_{port}.txt",
+                testname,
             )
 
             # Compare the files and delete the files after
-- 
2.25.1


  parent reply	other threads:[~2022-03-22 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 15:05 [dts][PATCH V1 0/2] eeprom dump Yaqi Tang
2022-03-22 15:05 ` [dts][PATCH V1 1/2] test_plans/eeprom_dump: modify test plan for columbiaville nic Yaqi Tang
2022-03-22 15:05 ` Yaqi Tang [this message]
2022-03-23  7:20   ` [dts][PATCH V1 2/2] tests/eeprom_dump: modify testsuite " lijuan.tu

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=20220322150523.845757-3-yaqi.tang@intel.com \
    --to=yaqi.tang@intel.com \
    --cc=dts@dpdk.org \
    --cc=ohilyard@iol.unh.edu \
    --cc=xueqin.lin@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).