From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1CA06A04DB; Tue, 1 Dec 2020 10:19:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E750FC982; Tue, 1 Dec 2020 10:19:27 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5E309C956 for ; Tue, 1 Dec 2020 10:19:25 +0100 (CET) IronPort-SDR: XUC+VIeYepV9qN8niWPep/5UoUytTQXqB2VaaLZauTYpJpe6CIKKEjvSgWWWnxV15c4BDX6f3s /QC2HSrOngHg== X-IronPort-AV: E=McAfee;i="6000,8403,9821"; a="172955295" X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="172955295" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 01:19:22 -0800 IronPort-SDR: DuEBsNti3r9arWETe3t7hDqhi5hqzkK2LXQLpa4Br4Qoa+1Qbgp1sGhGej0pq91mhv334/4Cta XMjI+MLc12Zw== X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="549482780" Received: from unknown (HELO dpdk-wenjielx-tetser203.icx.intel.com) ([10.240.183.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 01:19:20 -0800 From: "Chen, Lingli" To: dts@dpdk.org Cc: "Chen, Lingli" , Chen@dpdk.org Date: Tue, 1 Dec 2020 17:57:50 +0000 Message-Id: <20201201175750.24381-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V2] tests/TestSuite_shutdown_api:fixed differences brought about by speed units X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" V2:optimize script to fixed differences brought about by speed units Sagepond nic only support 1000baseT and 10000baseT V1:fixed differences brought about by speed units Signed-off-by: Chen, Lingli --- tests/TestSuite_shutdown_api.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 1e98c64..c647870 100644 --- a/tests/TestSuite_shutdown_api.py +++ b/tests/TestSuite_shutdown_api.py @@ -501,7 +501,7 @@ class TestShutdownApi(TestCase): if config[0] != '1000' or '10000': continue elif self.nic in ["sagepond"]: - if config[0] != '1000' and '10000': + if config[0] not in ['1000', '10000']: continue self.dut.send_expect("port stop all", "testpmd> ", 100) for port in self.ports: @@ -515,8 +515,13 @@ class TestShutdownApi(TestCase): out = self.dut.send_expect("show port info %s" % port, "testpmd>") self.verify("Link status: up" in out, "Wrong link status reported by the dut") - self.verify("Link speed: %s Mbps" % config[0] in out, - "Wrong speed reported by the dut") + if int(config[0]) < 1000: + self.verify("Link speed: %s Mbps" % config[0] in out, + "Wrong speed reported by the dut") + else: + num =int(int(config[0])/1000) + self.verify("Link speed: %d Gbps" % num in out, + "Wrong speed reported by the dut") self.verify("Link duplex: %s-duplex" % config[1].lower() in out, "Wrong link type reported by the dut") out = self.tester.send_expect( @@ -547,7 +552,7 @@ class TestShutdownApi(TestCase): if not self.check_linkspeed_config(configs): return - result_linkspeed_scanner = r"Link\s*speed:\s([0-9]+)\s*Mbps" + result_linkspeed_scanner = r"Link\s*speed:\s([0-9]+)\s*(\S+)" linkspeed_scanner = re.compile(result_linkspeed_scanner, re.DOTALL) result_linktype_scanner = r"Link\s*duplex:\s*(\S*)\s*-\s*duplex" linktype_scanner = re.compile(result_linktype_scanner, re.DOTALL) @@ -577,10 +582,13 @@ class TestShutdownApi(TestCase): out = self.vm0_testpmd.execute_cmd('show port info all') - linkspeed = linkspeed_scanner.findall(out) + linkspeed = linkspeed_scanner.findall(out)[0] linktype = linktype_scanner.findall(out) - self.verify(config[0] in linkspeed, + actual_speed = int(linkspeed[0]) + if linkspeed[1] == "Gbps": + actual_speed = actual_speed * 1000 + self.verify(config[0] == str(actual_speed), "Wrong VF speed reported by the self.tester.") self.verify(config[1].lower() == linktype[0].lower(), "Wrong VF link type reported by the self.tester.") -- 2.17.1