test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] shutdown_api: support vector mode to this test
@ 2019-10-19 16:56 pvukkisala
  2019-10-23  9:51 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: pvukkisala @ 2019-10-19 16:56 UTC (permalink / raw)
  To: dts; +Cc: avijay, fmasood, Phanendra Vukkisala

From: Phanendra Vukkisala <pvukkisala@marvell.com>

Vector mode needs multiple of 4 packets
Make sure link is up at end of tests(even test fails) to avoid further tests failure

Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
 tests/TestSuite_shutdown_api.py |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 32bb765..d7f070f 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -116,7 +116,7 @@ class TestShutdownApi(TestCase):
             pkg = 'Ether(src="%s", dst="%s")/IP()/Raw(load="P" * %d)' % (smac, dmac, padding)
 
         self.tester.scapy_foreground()
-        self.tester.scapy_append('sendp(%s, iface="%s")' % (pkg, itf))
+        self.tester.scapy_append('sendp(%s, iface="%s", count=4)' % (pkg, itf))
         self.tester.scapy_execute()
         time.sleep(3)
 
@@ -131,8 +131,8 @@ class TestShutdownApi(TestCase):
         p1rx_pkts -= gp1rx_pkts
         p1rx_bytes -= gp1rx_bytes
 
-        rx_bytes_exp = pktSize
-        tx_bytes_exp = pktSize
+        rx_bytes_exp = pktSize*4
+        tx_bytes_exp = pktSize*4
 
         if self.kdriver == "fm10k":
             # RRC will always strip rx/tx crc
@@ -144,11 +144,11 @@ class TestShutdownApi(TestCase):
                 tx_bytes_exp -= 4
         else:
             # some NIC will always include tx crc
-            rx_bytes_exp -= 4
-            tx_bytes_exp -= 4
+            rx_bytes_exp -= 16
+            tx_bytes_exp -= 16
             if vlan_strip is True:
                 # vlan strip default is off
-                tx_bytes_exp -= 4
+                tx_bytes_exp -= 16
          
         # fortville nic enable send lldp packet function when port setup
         # now the tx-packets size is lldp_size(110) * n + forward packe size
@@ -548,6 +548,16 @@ class TestShutdownApi(TestCase):
         Run after each test case.
         """
         self.dut.kill_all()
+        self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+        ports_num = len(self.ports)
+        # link up test, to avoid failing further tests if link was down
+        for i in range(ports_num):
+            ## sometimes output text messingup testpmd prompt so trimmed prompt
+            self.dut.send_expect("set link-up port %d" % i, ">")
+        # start ports, to avodi failing further tests if ports are stoped
+        self.dut.send_expect("port start all", "testpmd> ", 100)
+        self.dut.send_expect("quit", "# ")
+
 
     def tear_down_all(self):
         """
-- 
1.7.9.5


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

* Re: [dts] [PATCH] shutdown_api: support vector mode to this test
  2019-10-19 16:56 [dts] [PATCH] shutdown_api: support vector mode to this test pvukkisala
@ 2019-10-23  9:51 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-10-23  9:51 UTC (permalink / raw)
  To: pvukkisala, dts; +Cc: avijay, fmasood

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of
> pvukkisala@marvell.com
> Sent: Sunday, October 20, 2019 12:56 AM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] shutdown_api: support vector mode to this test
> 
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
> 
> Vector mode needs multiple of 4 packets
> Make sure link is up at end of tests(even test fails) to avoid further tests
> failure
> 
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
>  tests/TestSuite_shutdown_api.py |   22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/TestSuite_shutdown_api.py
> b/tests/TestSuite_shutdown_api.py index 32bb765..d7f070f 100644
> --- a/tests/TestSuite_shutdown_api.py
> +++ b/tests/TestSuite_shutdown_api.py
> @@ -116,7 +116,7 @@ class TestShutdownApi(TestCase):
>              pkg = 'Ether(src="%s", dst="%s")/IP()/Raw(load="P" * %d)' % (smac,
> dmac, padding)
> 
>          self.tester.scapy_foreground()
> -        self.tester.scapy_append('sendp(%s, iface="%s")' % (pkg, itf))
> +        self.tester.scapy_append('sendp(%s, iface="%s", count=4)' %
> + (pkg, itf))
>          self.tester.scapy_execute()
>          time.sleep(3)
> 
> @@ -131,8 +131,8 @@ class TestShutdownApi(TestCase):
>          p1rx_pkts -= gp1rx_pkts
>          p1rx_bytes -= gp1rx_bytes
> 
> -        rx_bytes_exp = pktSize
> -        tx_bytes_exp = pktSize
> +        rx_bytes_exp = pktSize*4
> +        tx_bytes_exp = pktSize*4
> 
>          if self.kdriver == "fm10k":
>              # RRC will always strip rx/tx crc @@ -144,11 +144,11 @@ class
> TestShutdownApi(TestCase):
>                  tx_bytes_exp -= 4
>          else:
>              # some NIC will always include tx crc
> -            rx_bytes_exp -= 4
> -            tx_bytes_exp -= 4
> +            rx_bytes_exp -= 16
> +            tx_bytes_exp -= 16
>              if vlan_strip is True:
>                  # vlan strip default is off
> -                tx_bytes_exp -= 4
> +                tx_bytes_exp -= 16
> 
>          # fortville nic enable send lldp packet function when port setup
>          # now the tx-packets size is lldp_size(110) * n + forward packe size @@ -
> 548,6 +548,16 @@ class TestShutdownApi(TestCase):
>          Run after each test case.
>          """
>          self.dut.kill_all()
> +        self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> +        ports_num = len(self.ports)
> +        # link up test, to avoid failing further tests if link was down
> +        for i in range(ports_num):
> +            ## sometimes output text messingup testpmd prompt so trimmed
> prompt
> +            self.dut.send_expect("set link-up port %d" % i, ">")
> +        # start ports, to avodi failing further tests if ports are stoped
> +        self.dut.send_expect("port start all", "testpmd> ", 100)
> +        self.dut.send_expect("quit", "# ")
> +
> 
>      def tear_down_all(self):
>          """
> --
> 1.7.9.5


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

end of thread, other threads:[~2019-10-23  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-19 16:56 [dts] [PATCH] shutdown_api: support vector mode to this test pvukkisala
2019-10-23  9:51 ` 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).