test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] tests/dual_vlan check if the port is up
@ 2018-12-29  8:20 zhuwenhui
  2018-12-29  8:50 ` Zhu, ShuaiX
  2019-01-11  1:32 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: zhuwenhui @ 2018-12-29  8:20 UTC (permalink / raw)
  To: dts; +Cc: zhuwenhui

The port is down when the packet is sent. After "start", 
make sure the port is really open, and then proceed to the next step.

Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
---
 tests/TestSuite_dual_vlan.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py
index 994ac42..cbb87d4 100644
--- a/tests/TestSuite_dual_vlan.py
+++ b/tests/TestSuite_dual_vlan.py
@@ -40,6 +40,7 @@ Test the support of Dual VLAN Offload Features by Poll Mode Drivers.
 import utils
 import random
 import re
+import time
 
 txvlan = 3
 outvlan = 1
@@ -182,6 +183,16 @@ class TestDualVlan(TestCase):
             else:
                 self.verify("%s %s" % (mode, modeName[mode]) in out, "%s setting error" % mode)
 
+    def show_port(self):
+        out = self.dut.send_expect("show port info all", "testpmd> ")
+        global port_time_up
+        port_time_up = 0
+        while (port_time_up <= 10) and ("Link status: down" in out):
+            time.sleep(1)
+            out = self.dut.send_expect("show port info all", "testpmd> ")
+            port_time_up += 1
+        self.verify("Link status: down" not in out, "Port open failed")
+
     def multimode_test(self, caseIndex):
         """
         Setup Strip/Filter/Extend/Insert enable/disable for synthetic test.
@@ -200,6 +211,7 @@ class TestDualVlan(TestCase):
             self.dut.send_expect('tx_vlan set %s %s' % (dutTxPortId, txvlan), "testpmd> ")
             self.dut.send_expect('port start all', "testpmd> ")
             self.dut.send_expect('start', "testpmd> ")
+            self.show_port()
 
         configMode = "Strip %s, filter %s 0x1, extend %s, insert %s" % (temp[0], temp[1], temp[2], "on" if (caseDef & txCase) != 0 else "off")
 
@@ -218,6 +230,7 @@ class TestDualVlan(TestCase):
                 self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
                 self.dut.send_expect('port start all', "testpmd> ")
                 self.dut.send_expect('start', "testpmd> ")
+                self.show_port()
 
         else:
             self.dut.send_expect('rx_vlan add %s %s' % (invlan, dutRxPortId), "testpmd> ")
@@ -230,6 +243,7 @@ class TestDualVlan(TestCase):
                 self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
                 self.dut.send_expect('port start all', "testpmd> ")
                 self.dut.send_expect('start', "testpmd> ")
+                self.show_port()
             self.dut.send_expect('rx_vlan rm %s %s' % (invlan, dutRxPortId), "testpmd> ")
             self.dut.send_expect('rx_vlan rm %s %s' % (outvlan, dutRxPortId), "testpmd> ")
 
@@ -364,6 +378,7 @@ class TestDualVlan(TestCase):
         self.dut.send_expect("tx_vlan set %s %s" % (dutTxPortId, txvlan), "testpmd> ")
         self.dut.send_expect("port start all", "testpmd> ")
         self.dut.send_expect("start", "testpmd> ")
+        self.show_port()
 
         self.vlan_send_packet()
         out = self.get_tcpdump_package()
@@ -374,6 +389,7 @@ class TestDualVlan(TestCase):
         self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ")
         self.dut.send_expect("port start all", "testpmd> ")
         self.dut.send_expect("start", "testpmd> ")
+        self.show_port()
 
         self.vlan_send_packet()
         out = self.get_tcpdump_package()
-- 
2.17.2

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

* Re: [dts] [PATCH V2] tests/dual_vlan check if the port is up
  2018-12-29  8:20 [dts] [PATCH V2] tests/dual_vlan check if the port is up zhuwenhui
@ 2018-12-29  8:50 ` Zhu, ShuaiX
  2019-01-11  1:32 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhu, ShuaiX @ 2018-12-29  8:50 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX, Zhu, ShuaiX

Tested-by: Zhu, ShuaiX <shuaix.zhu@intel.com>

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
> Sent: Saturday, December 29, 2018 4:21 PM
> To: dts@dpdk.org
> Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
> Subject: [dts] [PATCH V2] tests/dual_vlan check if the port is up
> 
> The port is down when the packet is sent. After "start", make sure the port is
> really open, and then proceed to the next step.
> 
> Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
> ---
>  tests/TestSuite_dual_vlan.py | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py index
> 994ac42..cbb87d4 100644
> --- a/tests/TestSuite_dual_vlan.py
> +++ b/tests/TestSuite_dual_vlan.py
> @@ -40,6 +40,7 @@ Test the support of Dual VLAN Offload Features by Poll
> Mode Drivers.
>  import utils
>  import random
>  import re
> +import time
> 
>  txvlan = 3
>  outvlan = 1
> @@ -182,6 +183,16 @@ class TestDualVlan(TestCase):
>              else:
>                  self.verify("%s %s" % (mode, modeName[mode]) in out,
> "%s setting error" % mode)
> 
> +    def show_port(self):
> +        out = self.dut.send_expect("show port info all", "testpmd> ")
> +        global port_time_up
> +        port_time_up = 0
> +        while (port_time_up <= 10) and ("Link status: down" in out):
> +            time.sleep(1)
> +            out = self.dut.send_expect("show port info all", "testpmd> ")
> +            port_time_up += 1
> +        self.verify("Link status: down" not in out, "Port open failed")
> +
>      def multimode_test(self, caseIndex):
>          """
>          Setup Strip/Filter/Extend/Insert enable/disable for synthetic test.
> @@ -200,6 +211,7 @@ class TestDualVlan(TestCase):
>              self.dut.send_expect('tx_vlan set %s %s' % (dutTxPortId,
> txvlan), "testpmd> ")
>              self.dut.send_expect('port start all', "testpmd> ")
>              self.dut.send_expect('start', "testpmd> ")
> +            self.show_port()
> 
>          configMode = "Strip %s, filter %s 0x1, extend %s, insert %s" %
> (temp[0], temp[1], temp[2], "on" if (caseDef & txCase) != 0 else "off")
> 
> @@ -218,6 +230,7 @@ class TestDualVlan(TestCase):
>                  self.dut.send_expect('tx_vlan reset %s' % dutTxPortId,
> "testpmd> ")
>                  self.dut.send_expect('port start all', "testpmd> ")
>                  self.dut.send_expect('start', "testpmd> ")
> +                self.show_port()
> 
>          else:
>              self.dut.send_expect('rx_vlan add %s %s' % (invlan,
> dutRxPortId), "testpmd> ") @@ -230,6 +243,7 @@ class
> TestDualVlan(TestCase):
>                  self.dut.send_expect('tx_vlan reset %s' % dutTxPortId,
> "testpmd> ")
>                  self.dut.send_expect('port start all', "testpmd> ")
>                  self.dut.send_expect('start', "testpmd> ")
> +                self.show_port()
>              self.dut.send_expect('rx_vlan rm %s %s' % (invlan,
> dutRxPortId), "testpmd> ")
>              self.dut.send_expect('rx_vlan rm %s %s' % (outvlan,
> dutRxPortId), "testpmd> ")
> 
> @@ -364,6 +378,7 @@ class TestDualVlan(TestCase):
>          self.dut.send_expect("tx_vlan set %s %s" % (dutTxPortId, txvlan),
> "testpmd> ")
>          self.dut.send_expect("port start all", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
> +        self.show_port()
> 
>          self.vlan_send_packet()
>          out = self.get_tcpdump_package() @@ -374,6 +389,7 @@ class
> TestDualVlan(TestCase):
>          self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd>
> ")
>          self.dut.send_expect("port start all", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
> +        self.show_port()
> 
>          self.vlan_send_packet()
>          out = self.get_tcpdump_package()
> --
> 2.17.2

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

* Re: [dts] [PATCH V2] tests/dual_vlan check if the port is up
  2018-12-29  8:20 [dts] [PATCH V2] tests/dual_vlan check if the port is up zhuwenhui
  2018-12-29  8:50 ` Zhu, ShuaiX
@ 2019-01-11  1:32 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-01-11  1:32 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX

Could you change an accurate name of show_port? The readers can't get your objective through your function name.
Through your function codes,  I got you want to verify the link status, so suggest you call it verify_link_up

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
> Sent: Saturday, December 29, 2018 4:21 PM
> To: dts@dpdk.org
> Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
> Subject: [dts] [PATCH V2] tests/dual_vlan check if the port is up
> 
> The port is down when the packet is sent. After "start", make sure the port is
> really open, and then proceed to the next step.
> 
> Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
> ---
>  tests/TestSuite_dual_vlan.py | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py index
> 994ac42..cbb87d4 100644
> --- a/tests/TestSuite_dual_vlan.py
> +++ b/tests/TestSuite_dual_vlan.py
> @@ -40,6 +40,7 @@ Test the support of Dual VLAN Offload Features by Poll
> Mode Drivers.
>  import utils
>  import random
>  import re
> +import time
> 
>  txvlan = 3
>  outvlan = 1
> @@ -182,6 +183,16 @@ class TestDualVlan(TestCase):
>              else:
>                  self.verify("%s %s" % (mode, modeName[mode]) in out, "%s setting
> error" % mode)
> 
> +    def show_port(self):
> +        out = self.dut.send_expect("show port info all", "testpmd> ")
> +        global port_time_up
> +        port_time_up = 0
> +        while (port_time_up <= 10) and ("Link status: down" in out):
> +            time.sleep(1)
> +            out = self.dut.send_expect("show port info all", "testpmd> ")
> +            port_time_up += 1
> +        self.verify("Link status: down" not in out, "Port open failed")
[Lijuan] Port open and link status are two different concepts, suggest change to "Port %s Link down, please check your link" % port_id
> +
>      def multimode_test(self, caseIndex):
>          """
>          Setup Strip/Filter/Extend/Insert enable/disable for synthetic test.
> @@ -200,6 +211,7 @@ class TestDualVlan(TestCase):
>              self.dut.send_expect('tx_vlan set %s %s' % (dutTxPortId, txvlan),
> "testpmd> ")
>              self.dut.send_expect('port start all', "testpmd> ")
>              self.dut.send_expect('start', "testpmd> ")
> +            self.show_port()
> 
>          configMode = "Strip %s, filter %s 0x1, extend %s, insert %s" % (temp[0],
> temp[1], temp[2], "on" if (caseDef & txCase) != 0 else "off")
> 
> @@ -218,6 +230,7 @@ class TestDualVlan(TestCase):
>                  self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
>                  self.dut.send_expect('port start all', "testpmd> ")
>                  self.dut.send_expect('start', "testpmd> ")
> +                self.show_port()
> 
>          else:
>              self.dut.send_expect('rx_vlan add %s %s' % (invlan, dutRxPortId),
> "testpmd> ") @@ -230,6 +243,7 @@ class TestDualVlan(TestCase):
>                  self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
>                  self.dut.send_expect('port start all', "testpmd> ")
>                  self.dut.send_expect('start', "testpmd> ")
> +                self.show_port()
>              self.dut.send_expect('rx_vlan rm %s %s' % (invlan, dutRxPortId), "testpmd>
> ")
>              self.dut.send_expect('rx_vlan rm %s %s' % (outvlan, dutRxPortId),
> "testpmd> ")
> 
> @@ -364,6 +378,7 @@ class TestDualVlan(TestCase):
>          self.dut.send_expect("tx_vlan set %s %s" % (dutTxPortId, txvlan), "testpmd>
> ")
>          self.dut.send_expect("port start all", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
> +        self.show_port()
> 
>          self.vlan_send_packet()
>          out = self.get_tcpdump_package() @@ -374,6 +389,7 @@ class
> TestDualVlan(TestCase):
>          self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ")
>          self.dut.send_expect("port start all", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
> +        self.show_port()
> 
>          self.vlan_send_packet()
>          out = self.get_tcpdump_package()
> --
> 2.17.2

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

end of thread, other threads:[~2019-01-11  1:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29  8:20 [dts] [PATCH V2] tests/dual_vlan check if the port is up zhuwenhui
2018-12-29  8:50 ` Zhu, ShuaiX
2019-01-11  1:32 ` 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).