test suite reviews and discussions
 help / color / mirror / Atom feed
From: xuhailin <hailinx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,hailin" <hailinx.xu@intel.com>
Subject: [dts] [PATCH v1]tests/userspace_ethtool: optimize code
Date: Tue,  7 Jan 2020 10:59:19 +0800	[thread overview]
Message-ID: <1578365959-76061-1-git-send-email-hailinx.xu@intel.com> (raw)

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


             reply	other threads:[~2020-01-07  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  2:59 xuhailin [this message]
2020-01-07  7:12 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1578365959-76061-1-git-send-email-hailinx.xu@intel.com \
    --to=hailinx.xu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).