From patchwork Tue Mar 22 15:05:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaqi Tang X-Patchwork-Id: 108812 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16DF7A04FF; Tue, 22 Mar 2022 16:05:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 117D3427ED; Tue, 22 Mar 2022 16:05:44 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 26824427F2 for ; Tue, 22 Mar 2022 16:05:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647961543; x=1679497543; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ikwXR0QK0xWpyT5NiYjMjq1ZqE1bkXlrOCV17N/W3tU=; b=TyxDif7nILqU7EW1N2pfVltd4sC7u/4ShgDRWhNiA6F7y+oq0m2sN86q JIWF9c5LXalyQsTflfShm04B9VbipBCSorx2jmU6nGII+WXYacVhJq9F0 hy9emKay7fZSoTQa0KVeMs/3UxOHj8KvqPPG0ieqLJNWbMTGEykRxH86D vIP0PNkeYOGAlNzNukZ2p3NhSvF2Pjgu5HzGmoopQEL6y5YhGG1WYLrCy xGA14KSa0E7TDsUzXtaHmjkkSKNZX0n2j8Q+NksnzuVlMJOs5lpaSv+CA sL5M+r5kXfaX5GUD8gFlVHObhjfVmSzO//BduzUeApmf09+nkN8GxGJp4 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10294"; a="256661097" X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="256661097" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 08:05:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,201,1643702400"; d="scan'208";a="692573891" Received: from dpdk-yaqi.sh.intel.com ([10.67.118.156]) by fmsmga001.fm.intel.com with ESMTP; 22 Mar 2022 08:05:28 -0700 From: Yaqi Tang To: ohilyard@iol.unh.edu Cc: dts@dpdk.org, xueqin.lin@intel.com, Yaqi Tang Subject: [dts][PATCH V1 2/2] tests/eeprom_dump: modify testsuite for columbiaville nic Date: Tue, 22 Mar 2022 23:05:23 +0800 Message-Id: <20220322150523.845757-3-yaqi.tang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220322150523.845757-1-yaqi.tang@intel.com> References: <20220322150523.845757-1-yaqi.tang@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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 --- 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