test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/link_flowctrl: fix syntax error
@ 2019-03-25 15:42 zhaomeijuan
  2019-04-03 16:23 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: zhaomeijuan @ 2019-03-25 15:42 UTC (permalink / raw)
  To: dts; +Cc: meijuanx.zhao

From: "meijuanx.zhao" <meijuanx.zhao@intel.com>

Signed-off-by: meijuanx.zhao <meijuanx.zhao@intel.com>
---
 tests/TestSuite_link_flowctrl.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_link_flowctrl.py b/tests/TestSuite_link_flowctrl.py
index 0057b46..83fd724 100644
--- a/tests/TestSuite_link_flowctrl.py
+++ b/tests/TestSuite_link_flowctrl.py
@@ -339,9 +339,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='on',
                                             pause_frame_fwd='on')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result <= 0.01,
+        self.verify(result[0] <= 0.01,
                     "Link flow control fail, the loss percent is more than 1%")
 
     def test_perf_flowctrl_on_pause_fwd_off(self):
@@ -353,9 +353,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='on',
                                             pause_frame_fwd='off')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result <= 0.01,
+        self.verify(result[0] <= 0.01,
                     "Link flow control fail, the loss percent is more than 1%")
 
     def test_perf_flowctrl_rx_on(self):
@@ -367,9 +367,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='on',
                                             pause_frame_fwd='off')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result <= 0.01,
+        self.verify(result[0] <= 0.01,
                     "Link flow control fail, the loss percent is more than 1%")
 
     def test_perf_flowctrl_off_pause_fwd_on(self):
@@ -381,9 +381,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='off',
                                             pause_frame_fwd='on')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result >= 0.5,
+        self.verify(result[0] >= 0.5,
                     "Link flow control fail, the loss percent is less than 50%")
 
     def test_perf_flowctrl_off_pause_fwd_off(self):
@@ -395,9 +395,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='off',
                                             pause_frame_fwd='off')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result >= 0.5,
+        self.verify(result[0] >= 0.5,
                     "Link flow control fail, the loss percent is less than 50%")
 
     def test_perf_flowctrl_tx_on(self):
@@ -409,9 +409,9 @@ class TestLinkFlowctrl(TestCase):
                                             tx_flow_control='on',
                                             pause_frame_fwd='off')
 
-        print "Packet loss: %.3f%%" % result
+        print "Packet loss: %.3f%%" % result[0]
 
-        self.verify(result <= 0.01,
+        self.verify(result[0] <= 0.01,
                     "Link flow control fail, the loss percent is more than 1%")
 
     def tear_down_all(self):
-- 
2.17.1


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

* Re: [dts] [PATCH V1] tests/link_flowctrl: fix syntax error
  2019-03-25 15:42 [dts] [PATCH V1] tests/link_flowctrl: fix syntax error zhaomeijuan
@ 2019-04-03 16:23 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-04-03 16:23 UTC (permalink / raw)
  To: Zhao, MeijuanX, dts; +Cc: Zhao, MeijuanX

The function has 3 return value, if you just want the first value,  it's more readable:

Result, _, _ = self.tester.traffic_generator_loss(tgenInput, 100)

Only 1 change could solve your problem, it's a more easy way.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhaomeijuan
> Sent: Monday, March 25, 2019 8:43 AM
> To: dts@dpdk.org
> Cc: Zhao, MeijuanX <meijuanx.zhao@intel.com>
> Subject: [dts] [PATCH V1] tests/link_flowctrl: fix syntax error
> 
> From: "meijuanx.zhao" <meijuanx.zhao@intel.com>
> 
> Signed-off-by: meijuanx.zhao <meijuanx.zhao@intel.com>
> ---
>  tests/TestSuite_link_flowctrl.py | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/TestSuite_link_flowctrl.py b/tests/TestSuite_link_flowctrl.py
> index 0057b46..83fd724 100644
> --- a/tests/TestSuite_link_flowctrl.py
> +++ b/tests/TestSuite_link_flowctrl.py
> @@ -339,9 +339,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='on',
>                                              pause_frame_fwd='on')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result <= 0.01,
> +        self.verify(result[0] <= 0.01,
>                      "Link flow control fail, the loss percent is more than 1%")
> 
>      def test_perf_flowctrl_on_pause_fwd_off(self):
> @@ -353,9 +353,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='on',
>                                              pause_frame_fwd='off')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result <= 0.01,
> +        self.verify(result[0] <= 0.01,
>                      "Link flow control fail, the loss percent is more than 1%")
> 
>      def test_perf_flowctrl_rx_on(self):
> @@ -367,9 +367,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='on',
>                                              pause_frame_fwd='off')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result <= 0.01,
> +        self.verify(result[0] <= 0.01,
>                      "Link flow control fail, the loss percent is more than 1%")
> 
>      def test_perf_flowctrl_off_pause_fwd_on(self):
> @@ -381,9 +381,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='off',
>                                              pause_frame_fwd='on')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result >= 0.5,
> +        self.verify(result[0] >= 0.5,
>                      "Link flow control fail, the loss percent is less than 50%")
> 
>      def test_perf_flowctrl_off_pause_fwd_off(self):
> @@ -395,9 +395,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='off',
>                                              pause_frame_fwd='off')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result >= 0.5,
> +        self.verify(result[0] >= 0.5,
>                      "Link flow control fail, the loss percent is less than 50%")
> 
>      def test_perf_flowctrl_tx_on(self):
> @@ -409,9 +409,9 @@ class TestLinkFlowctrl(TestCase):
>                                              tx_flow_control='on',
>                                              pause_frame_fwd='off')
> 
> -        print "Packet loss: %.3f%%" % result
> +        print "Packet loss: %.3f%%" % result[0]
> 
> -        self.verify(result <= 0.01,
> +        self.verify(result[0] <= 0.01,
>                      "Link flow control fail, the loss percent is more than 1%")
> 
>      def tear_down_all(self):
> --
> 2.17.1


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

end of thread, other threads:[~2019-04-03 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 15:42 [dts] [PATCH V1] tests/link_flowctrl: fix syntax error zhaomeijuan
2019-04-03 16:23 ` 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).