test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up
@ 2017-08-04  7:19 Herbert Guan
  2017-08-07  2:42 ` Liu, Yong
  2017-08-07  3:16 ` [dts] [PATCH v2] " Herbert Guan
  0 siblings, 2 replies; 6+ messages in thread
From: Herbert Guan @ 2017-08-04  7:19 UTC (permalink / raw)
  To: dts, jianbo.liu; +Cc: Herbert Guan

It'll take some time for links up after testpmd is started.
Before that "testpmd>" will be prompted but test shall not start
until links are up.  "Link Up" is a better checker for a specific
test case.  While since pmd_output.py is usd by many test cases, wait
10 seconds will be safer, in case of some test cases do not actually
expect for an established link.

Signed-off-by: Herbert Guan <herbert.guan@arm.com>
---
 framework/pmd_output.py             | 3 +++
 tests/TestSuite_dynamic_config.py   | 2 +-
 tests/TestSuite_queue_start_stop.py | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 260f42c..2d1e3d7 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,6 +31,7 @@
 
 import os
 import re
+from time import sleep
 from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
 from utils import create_mask
 
@@ -119,6 +120,8 @@ class PmdOutput():
             command += " --disable-hw-vlan-filter"
         out = self.dut.send_expect(command, "testpmd> ", 120)
         self.command = command
+        # wait 10s to ensure links getting up before test start.
+        sleep(10)
         return out
 
     def execute_cmd(self, pmd_cmd, expected='testpmd> ', timeout=TIMEOUT,
diff --git a/tests/TestSuite_dynamic_config.py b/tests/TestSuite_dynamic_config.py
index b4ddede..e344aac 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -121,7 +121,7 @@ class TestDynamicConfig(TestCase):
 	if "cavium" in self.dut.nic_type:
             cmd += " --disable-hw-vlan-filter"
 
-        self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
+        self.dut.send_expect("%s" % cmd, "Link Up", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
 
 
diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index d1df66b..9e190f6 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -130,7 +130,7 @@ class TestQueueStartStop(TestCase):
         """
         #dpdk start
         try:
-            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
+            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "Link Up", 120)
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
             self.check_forwarding([0, 0], self.nic)
-- 
1.8.3.1

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

* Re: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up
  2017-08-04  7:19 [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up Herbert Guan
@ 2017-08-07  2:42 ` Liu, Yong
  2017-08-07  3:25   ` Herbert Guan
  2017-08-07  3:16 ` [dts] [PATCH v2] " Herbert Guan
  1 sibling, 1 reply; 6+ messages in thread
From: Liu, Yong @ 2017-08-07  2:42 UTC (permalink / raw)
  To: Herbert Guan, dts, jianbo.liu

Hi Herbert,
Not every kind of NIC will output link up message, e.g. FVL will not show "Link Up" when LSC event coming. 
Waiting for "LSC event" will be more suitable for the expecting prompt. 

Agreed with change in pmd_ouput module, waiting 10 seconds will ensure the stability of link status.

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Herbert Guan
> Sent: Friday, August 04, 2017 3:20 PM
> To: dts@dpdk.org; jianbo.liu@linaro.org
> Cc: Herbert Guan <herbert.guan@arm.com>
> Subject: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to
> ensure link is up
> 
> It'll take some time for links up after testpmd is started.
> Before that "testpmd>" will be prompted but test shall not start
> until links are up.  "Link Up" is a better checker for a specific
> test case.  While since pmd_output.py is usd by many test cases, wait
> 10 seconds will be safer, in case of some test cases do not actually
> expect for an established link.
> 
> Signed-off-by: Herbert Guan <herbert.guan@arm.com>
> ---
>  framework/pmd_output.py             | 3 +++
>  tests/TestSuite_dynamic_config.py   | 2 +-
>  tests/TestSuite_queue_start_stop.py | 2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/pmd_output.py b/framework/pmd_output.py
> index 260f42c..2d1e3d7 100644
> --- a/framework/pmd_output.py
> +++ b/framework/pmd_output.py
> @@ -31,6 +31,7 @@
> 
>  import os
>  import re
> +from time import sleep
>  from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
>  from utils import create_mask
> 
> @@ -119,6 +120,8 @@ class PmdOutput():
>              command += " --disable-hw-vlan-filter"
>          out = self.dut.send_expect(command, "testpmd> ", 120)
>          self.command = command
> +        # wait 10s to ensure links getting up before test start.
> +        sleep(10)
>          return out
> 
>      def execute_cmd(self, pmd_cmd, expected='testpmd> ', timeout=TIMEOUT,
> diff --git a/tests/TestSuite_dynamic_config.py
> b/tests/TestSuite_dynamic_config.py
> index b4ddede..e344aac 100644
> --- a/tests/TestSuite_dynamic_config.py
> +++ b/tests/TestSuite_dynamic_config.py
> @@ -121,7 +121,7 @@ class TestDynamicConfig(TestCase):
>  	if "cavium" in self.dut.nic_type:
>              cmd += " --disable-hw-vlan-filter"
> 
> -        self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
> +        self.dut.send_expect("%s" % cmd, "Link Up", 120)
>          self.dut.send_expect("start", "testpmd> ", 120)
> 
> 
> diff --git a/tests/TestSuite_queue_start_stop.py
> b/tests/TestSuite_queue_start_stop.py
> index d1df66b..9e190f6 100644
> --- a/tests/TestSuite_queue_start_stop.py
> +++ b/tests/TestSuite_queue_start_stop.py
> @@ -130,7 +130,7 @@ class TestQueueStartStop(TestCase):
>          """
>          #dpdk start
>          try:
> -            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -
> i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
> +            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -
> i --portmask=0x1 --port-topology=loop", "Link Up", 120)
>              self.dut.send_expect("set fwd mac", "testpmd>")
>              self.dut.send_expect("start", "testpmd>")
>              self.check_forwarding([0, 0], self.nic)
> --
> 1.8.3.1

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

* [dts] [PATCH v2] framework: wait 10 seconds after testpmd starts to ensure link is up
  2017-08-04  7:19 [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up Herbert Guan
  2017-08-07  2:42 ` Liu, Yong
@ 2017-08-07  3:16 ` Herbert Guan
  2017-08-07 11:38   ` [dts] [PATCH v3] " Herbert Guan
  1 sibling, 1 reply; 6+ messages in thread
From: Herbert Guan @ 2017-08-07  3:16 UTC (permalink / raw)
  To: dts, yong.liu; +Cc: jianbo.liu, Herbert Guan

It'll take some time for links up after testpmd is started.
Before that "testpmd>" will be prompted but test shall not start
until links are up.  "LSC event" is a better checker for a specific
test case.  While since pmd_output.py is usd by many test cases, wait
10 seconds will be safer, in case of some test cases do not actually
expect for an established link.

Signed-off-by: Herbert Guan <herbert.guan@arm.com>
---
 framework/pmd_output.py             | 3 +++
 tests/TestSuite_dynamic_config.py   | 2 +-
 tests/TestSuite_queue_start_stop.py | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 260f42c..2d1e3d7 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,6 +31,7 @@
 
 import os
 import re
+from time import sleep
 from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
 from utils import create_mask
 
@@ -119,6 +120,8 @@ class PmdOutput():
             command += " --disable-hw-vlan-filter"
         out = self.dut.send_expect(command, "testpmd> ", 120)
         self.command = command
+        # wait 10s to ensure links getting up before test start.
+        sleep(10)
         return out
 
     def execute_cmd(self, pmd_cmd, expected='testpmd> ', timeout=TIMEOUT,
diff --git a/tests/TestSuite_dynamic_config.py b/tests/TestSuite_dynamic_config.py
index b4ddede..4da493e 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -121,7 +121,7 @@ class TestDynamicConfig(TestCase):
 	if "cavium" in self.dut.nic_type:
             cmd += " --disable-hw-vlan-filter"
 
-        self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
+        self.dut.send_expect("%s" % cmd, "LSC event", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
 
 
diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index d1df66b..dea81c9 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -130,7 +130,7 @@ class TestQueueStartStop(TestCase):
         """
         #dpdk start
         try:
-            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
+            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "LSC event", 120)
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
             self.check_forwarding([0, 0], self.nic)
-- 
1.8.3.1

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

* Re: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up
  2017-08-07  2:42 ` Liu, Yong
@ 2017-08-07  3:25   ` Herbert Guan
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Guan @ 2017-08-07  3:25 UTC (permalink / raw)
  To: Liu, Yong, dts, jianbo.liu

Marvin,

Thanks for review.  V2 patch has been submitted just now.

Herbert

-----Original Message-----
From: Liu, Yong [mailto:yong.liu@intel.com]
Sent: Monday, August 7, 2017 10:42
To: Herbert Guan <Herbert.Guan@arm.com>; dts@dpdk.org; jianbo.liu@linaro.org
Subject: RE: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up

Hi Herbert,
Not every kind of NIC will output link up message, e.g. FVL will not show "Link Up" when LSC event coming.
Waiting for "LSC event" will be more suitable for the expecting prompt.

Agreed with change in pmd_ouput module, waiting 10 seconds will ensure the stability of link status.

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Herbert Guan
> Sent: Friday, August 04, 2017 3:20 PM
> To: dts@dpdk.org; jianbo.liu@linaro.org
> Cc: Herbert Guan <herbert.guan@arm.com>
> Subject: [dts] [PATCH] framework: wait 10 seconds after testpmd starts
> to ensure link is up
>
> It'll take some time for links up after testpmd is started.
> Before that "testpmd>" will be prompted but test shall not start until
> links are up.  "Link Up" is a better checker for a specific test case.
> While since pmd_output.py is usd by many test cases, wait
> 10 seconds will be safer, in case of some test cases do not actually
> expect for an established link.
>
> Signed-off-by: Herbert Guan <herbert.guan@arm.com>
> ---
>  framework/pmd_output.py             | 3 +++
>  tests/TestSuite_dynamic_config.py   | 2 +-
>  tests/TestSuite_queue_start_stop.py | 2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/framework/pmd_output.py b/framework/pmd_output.py index
> 260f42c..2d1e3d7 100644
> --- a/framework/pmd_output.py
> +++ b/framework/pmd_output.py
> @@ -31,6 +31,7 @@
>
>  import os
>  import re
> +from time import sleep
>  from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
> from utils import create_mask
>
> @@ -119,6 +120,8 @@ class PmdOutput():
>              command += " --disable-hw-vlan-filter"
>          out = self.dut.send_expect(command, "testpmd> ", 120)
>          self.command = command
> +        # wait 10s to ensure links getting up before test start.
> +        sleep(10)
>          return out
>
>      def execute_cmd(self, pmd_cmd, expected='testpmd> ',
> timeout=TIMEOUT, diff --git a/tests/TestSuite_dynamic_config.py
> b/tests/TestSuite_dynamic_config.py
> index b4ddede..e344aac 100644
> --- a/tests/TestSuite_dynamic_config.py
> +++ b/tests/TestSuite_dynamic_config.py
> @@ -121,7 +121,7 @@ class TestDynamicConfig(TestCase):
>  if "cavium" in self.dut.nic_type:
>              cmd += " --disable-hw-vlan-filter"
>
> -        self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
> +        self.dut.send_expect("%s" % cmd, "Link Up", 120)
>          self.dut.send_expect("start", "testpmd> ", 120)
>
>
> diff --git a/tests/TestSuite_queue_start_stop.py
> b/tests/TestSuite_queue_start_stop.py
> index d1df66b..9e190f6 100644
> --- a/tests/TestSuite_queue_start_stop.py
> +++ b/tests/TestSuite_queue_start_stop.py
> @@ -130,7 +130,7 @@ class TestQueueStartStop(TestCase):
>          """
>          #dpdk start
>          try:
> -            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -
> i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
> +            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4
> + -- -
> i --portmask=0x1 --port-topology=loop", "Link Up", 120)
>              self.dut.send_expect("set fwd mac", "testpmd>")
>              self.dut.send_expect("start", "testpmd>")
>              self.check_forwarding([0, 0], self.nic)
> --
> 1.8.3.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* [dts] [PATCH v3] framework: wait 10 seconds after testpmd starts to ensure link is up
  2017-08-07  3:16 ` [dts] [PATCH v2] " Herbert Guan
@ 2017-08-07 11:38   ` Herbert Guan
  2017-08-09 18:03     ` Liu, Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Guan @ 2017-08-07 11:38 UTC (permalink / raw)
  To: dts, yong.liu; +Cc: Herbert Guan

It'll take some time for links up after testpmd is started for
non-fiber test beds.
Before that "testpmd>" will be prompted but test shall not start
until links are up.  It's been tested that waiting 10 seconds can
resolve this issue on both fiber and non-fiber test beds.

Signed-off-by: Herbert Guan <herbert.guan@arm.com>
---
 framework/pmd_output.py             | 3 +++
 tests/TestSuite_dynamic_config.py   | 2 ++
 tests/TestSuite_queue_start_stop.py | 1 +
 3 files changed, 6 insertions(+)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 260f42c..2d1e3d7 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,6 +31,7 @@
 
 import os
 import re
+from time import sleep
 from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
 from utils import create_mask
 
@@ -119,6 +120,8 @@ class PmdOutput():
             command += " --disable-hw-vlan-filter"
         out = self.dut.send_expect(command, "testpmd> ", 120)
         self.command = command
+        # wait 10s to ensure links getting up before test start.
+        sleep(10)
         return out
 
     def execute_cmd(self, pmd_cmd, expected='testpmd> ', timeout=TIMEOUT,
diff --git a/tests/TestSuite_dynamic_config.py b/tests/TestSuite_dynamic_config.py
index b4ddede..699c303 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -37,6 +37,7 @@ Test the dynamic driver configuration feature.
 """
 
 import utils
+import time
 
 from test_case import TestCase
 
@@ -122,6 +123,7 @@ class TestDynamicConfig(TestCase):
             cmd += " --disable-hw-vlan-filter"
 
         self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
+        time.sleep(5)
         self.dut.send_expect("start", "testpmd> ", 120)
 
 
diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index d1df66b..cc031f5 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -131,6 +131,7 @@ class TestQueueStartStop(TestCase):
         #dpdk start
         try:
             self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
+            time.sleep(5)
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
             self.check_forwarding([0, 0], self.nic)
-- 
1.8.3.1

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

* Re: [dts] [PATCH v3] framework: wait 10 seconds after testpmd starts to ensure link is up
  2017-08-07 11:38   ` [dts] [PATCH v3] " Herbert Guan
@ 2017-08-09 18:03     ` Liu, Yong
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Yong @ 2017-08-09 18:03 UTC (permalink / raw)
  To: Herbert Guan, dts

Applied, thanks for your effort on testing with different beds.

On 08/07/2017 07:38 PM, Herbert Guan wrote:
> It'll take some time for links up after testpmd is started for
> non-fiber test beds.
> Before that "testpmd>" will be prompted but test shall not start
> until links are up.  It's been tested that waiting 10 seconds can
> resolve this issue on both fiber and non-fiber test beds.
>
> Signed-off-by: Herbert Guan<herbert.guan@arm.com>

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

end of thread, other threads:[~2017-08-09  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04  7:19 [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up Herbert Guan
2017-08-07  2:42 ` Liu, Yong
2017-08-07  3:25   ` Herbert Guan
2017-08-07  3:16 ` [dts] [PATCH v2] " Herbert Guan
2017-08-07 11:38   ` [dts] [PATCH v3] " Herbert Guan
2017-08-09 18:03     ` Liu, Yong

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