test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units
@ 2020-09-28  7:13 Chen Linglix
  2020-09-28  7:21 ` Chen, LingliX
  2020-10-12  6:39 ` Ma, LihongX
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Linglix @ 2020-09-28  7:13 UTC (permalink / raw)
  To: dts; +Cc: chenlinglix

From: chenlinglix <linglix.chen@intel.com>

fixed differences brought about by speed units

Signed-off-by: chenlinglix <linglix.chen@intel.com>
---
 tests/TestSuite_shutdown_api.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index edd1dcf..5255639 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -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 config[0] in['1000', '10000']:
+                    num =int(int(config[0])/1000)
+                    self.verify("Link speed: %d Gbps" % num in out,
+                                "Wrong speed reported by the dut")
+                else:
+                    self.verify("Link speed: %s Mbps" % config[0] 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)
@@ -576,11 +581,12 @@ class TestShutdownApi(TestCase):
                 time.sleep(1)
 
             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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units
  2020-09-28  7:13 [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units Chen Linglix
@ 2020-09-28  7:21 ` Chen, LingliX
  2020-10-12  6:39 ` Ma, LihongX
  1 sibling, 0 replies; 5+ messages in thread
From: Chen, LingliX @ 2020-09-28  7:21 UTC (permalink / raw)
  To: dts

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

Tested-by:  Chen, LingliX <linglix.chen@intel.com>

Regards,
Chen, LingliX

> -----Original Message-----
> From: Chen, LingliX
> Sent: Monday, September 28, 2020 3:13 PM
> To: dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1] tests/TestSuite_shutdown_api:fixed differences
> brought about by speed units

[-- Attachment #2: TestShutdownApi.log --]
[-- Type: application/octet-stream, Size: 46926 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units
  2020-09-28  7:13 [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units Chen Linglix
  2020-09-28  7:21 ` Chen, LingliX
@ 2020-10-12  6:39 ` Ma, LihongX
  2020-10-12  6:54   ` Chen, LingliX
  1 sibling, 1 reply; 5+ messages in thread
From: Ma, LihongX @ 2020-10-12  6:39 UTC (permalink / raw)
  To: Chen, LingliX, dts; +Cc: Chen, LingliX



> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Chen Linglix
> Sent: Monday, September 28, 2020 3:13 PM
> To: dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences
> brought about by speed units
> 
> From: chenlinglix <linglix.chen@intel.com>
> 
> fixed differences brought about by speed units
> 
> Signed-off-by: chenlinglix <linglix.chen@intel.com>
> -                self.verify("Link speed: %s Mbps" % config[0] in out,
> -                            "Wrong speed reported by the dut")
> +                if config[0] in['1000', '10000']:
> +                    num =int(int(config[0])/1000)
> +                    self.verify("Link speed: %d Gbps" % num in out,
> +                                "Wrong speed reported by the dut")
> +                else:
> +                    self.verify("Link speed: %s Mbps" % config[0] in out,
> +                                "Wrong speed reported by the dut")

Hi, lingli
Can you write clearly why do we need to do this change ? 


Regards,
Ma,lihong

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units
  2020-10-12  6:39 ` Ma, LihongX
@ 2020-10-12  6:54   ` Chen, LingliX
  2020-10-13  2:13     ` Tu, Lijuan
  0 siblings, 1 reply; 5+ messages in thread
From: Chen, LingliX @ 2020-10-12  6:54 UTC (permalink / raw)
  To: Ma, LihongX, dts

if change Link speed is1000 or 10000,the DUT's Link speed is 1 Gbps or 10 Gbps,
if change Link speed is100, the DUT's Link speed is 100 Mbps

> -----Original Message-----
> From: Ma, LihongX
> Sent: Monday, October 12, 2020 2:39 PM
> To: Chen, LingliX <linglix.chen@intel.com>; dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: RE: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed
> differences brought about by speed units
> 
> 
> 
> > -----Original Message-----
> > From: dts <dts-bounces@dpdk.org> On Behalf Of Chen Linglix
> > Sent: Monday, September 28, 2020 3:13 PM
> > To: dts@dpdk.org
> > Cc: Chen, LingliX <linglix.chen@intel.com>
> > Subject: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed
> > differences brought about by speed units
> >
> > From: chenlinglix <linglix.chen@intel.com>
> >
> > fixed differences brought about by speed units
> >
> > Signed-off-by: chenlinglix <linglix.chen@intel.com>
> > -                self.verify("Link speed: %s Mbps" % config[0] in out,
> > -                            "Wrong speed reported by the dut")
> > +                if config[0] in['1000', '10000']:
> > +                    num =int(int(config[0])/1000)
> > +                    self.verify("Link speed: %d Gbps" % num in out,
> > +                                "Wrong speed reported by the dut")
> > +                else:
> > +                    self.verify("Link speed: %s Mbps" % config[0] in out,
> > +                                "Wrong speed reported by the dut")
> 
> Hi, lingli
> Can you write clearly why do we need to do this change ?
> 
> 
> Regards,
> Ma,lihong


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units
  2020-10-12  6:54   ` Chen, LingliX
@ 2020-10-13  2:13     ` Tu, Lijuan
  0 siblings, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2020-10-13  2:13 UTC (permalink / raw)
  To: Chen, LingliX, Ma, LihongX, dts

> > Can you write clearly why do we need to do this change ?
> 
> if change Link speed is1000 or 10000,the DUT's Link speed is 1 Gbps or 10 Gbps,
> if change Link speed is100, the DUT's Link speed is 100 Mbps

It's not a good idea to get unit by value, if the speed is 1000Gbps(although we don't have it now, but soon in future), it can't know it is Gbps or Mbps.
Generally speaking, get unit first and then verify value.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-13  2:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  7:13 [dts] [PATCH V1] tests/TestSuite_shutdown_api:fixed differences brought about by speed units Chen Linglix
2020-09-28  7:21 ` Chen, LingliX
2020-10-12  6:39 ` Ma, LihongX
2020-10-12  6:54   ` Chen, LingliX
2020-10-13  2:13     ` Tu, Lijuan

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).