test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v1]tests/userspace_ethtool: optimize code
@ 2020-01-07  2:59 xuhailin
  2020-01-07  7:12 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: xuhailin @ 2020-01-07  2:59 UTC (permalink / raw)
  To: dts; +Cc: xu,hailin

From: "xu,hailin" <hailinx.xu@intel.com>

On some platforms, the port not up,add check port link status to make sure port link up

Signed-off-by: xu,hailin <hailinx.xu@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index e10c376..248d1d1 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -423,6 +423,8 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             self.verify(tx_ring == tx_max, "Userspace tool failed to set Tx ring parameter")
             pkt = Packet(pkt_type='UDP')
             tester_port = self.tester.get_local_port(port)
+            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
+                        'Fail to Open port{}'.format(index))
             intf = self.tester.get_interface(tester_port)
             pkt.send_pkt(self.tester, tx_port=intf, count=4)
             rx_pkts, tx_pkts = self.strip_portstats(index)
@@ -456,6 +458,8 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             pkt.config_layer('vlan', {'vlan': vlan})
             tester_port = self.tester.get_local_port(port)
             intf = self.tester.get_interface(tester_port)
+            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
+                        'Fail to Open port{}'.format(index))
             pkt.send_pkt(self.tester, tx_port=intf, count=4)
             rx_pkts, tx_pkts = self.strip_portstats(port)
             self.verify(rx_pkts == ori_rx_pkts + 4, "Failed to Rx vlan packet")
@@ -501,6 +505,8 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             pkt = Packet(pkt_type='UDP')
             tester_port = self.tester.get_local_port(port)
             intf = self.tester.get_interface(tester_port)
+            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
+                        'Fail to Open port{}'.format(index))
             # send and sniff packet
             inst = self.tester.tcpdump_sniff_packets(intf)
             pkt.send_pkt(self.tester, tx_port=intf, count=4)
-- 
2.17.2


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

* Re: [dts] [PATCH v1]tests/userspace_ethtool: optimize code
  2020-01-07  2:59 [dts] [PATCH v1]tests/userspace_ethtool: optimize code xuhailin
@ 2020-01-07  7:12 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-01-07  7:12 UTC (permalink / raw)
  To: Xu, HailinX, dts; +Cc: Xu, HailinX

applied

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xuhailin
> Sent: Tuesday, January 7, 2020 10:59 AM
> To: dts@dpdk.org
> Cc: Xu, HailinX <hailinx.xu@intel.com>
> Subject: [dts] [PATCH v1]tests/userspace_ethtool: optimize code
> 
> From: "xu,hailin" <hailinx.xu@intel.com>
> 
> On some platforms, the port not up,add check port link status to make sure
> port link up
> 
> Signed-off-by: xu,hailin <hailinx.xu@intel.com>
> ---
>  tests/TestSuite_userspace_ethtool.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/TestSuite_userspace_ethtool.py
> b/tests/TestSuite_userspace_ethtool.py
> index e10c376..248d1d1 100644
> --- a/tests/TestSuite_userspace_ethtool.py
> +++ b/tests/TestSuite_userspace_ethtool.py
> @@ -423,6 +423,8 @@ class TestUserspaceEthtool(TestCase,
> IxiaPacketGenerator):
>              self.verify(tx_ring == tx_max, "Userspace tool failed to set Tx ring
> parameter")
>              pkt = Packet(pkt_type='UDP')
>              tester_port = self.tester.get_local_port(port)
> +            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
> +                        'Fail to Open port{}'.format(index))
>              intf = self.tester.get_interface(tester_port)
>              pkt.send_pkt(self.tester, tx_port=intf, count=4)
>              rx_pkts, tx_pkts = self.strip_portstats(index) @@ -456,6 +458,8 @@
> class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
>              pkt.config_layer('vlan', {'vlan': vlan})
>              tester_port = self.tester.get_local_port(port)
>              intf = self.tester.get_interface(tester_port)
> +            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
> +                        'Fail to Open port{}'.format(index))
>              pkt.send_pkt(self.tester, tx_port=intf, count=4)
>              rx_pkts, tx_pkts = self.strip_portstats(port)
>              self.verify(rx_pkts == ori_rx_pkts + 4, "Failed to Rx vlan packet") @@ -
> 501,6 +505,8 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
>              pkt = Packet(pkt_type='UDP')
>              tester_port = self.tester.get_local_port(port)
>              intf = self.tester.get_interface(tester_port)
> +            self.verify(self.ethapp_check_link_status(index, 'Up') == True,
> +                        'Fail to Open port{}'.format(index))
>              # send and sniff packet
>              inst = self.tester.tcpdump_sniff_packets(intf)
>              pkt.send_pkt(self.tester, tx_port=intf, count=4)
> --
> 2.17.2


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

end of thread, other threads:[~2020-01-07  7:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  2:59 [dts] [PATCH v1]tests/userspace_ethtool: optimize code xuhailin
2020-01-07  7:12 ` 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).