test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link
@ 2018-06-15  8:58 Phil Yang
  2018-06-20 15:08 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Yang @ 2018-06-15  8:58 UTC (permalink / raw)
  To: dts; +Cc: nd, phil.yang

Test Case test_dump_driver_info will set ip link down to get the port
link down status. If verification is failed, it won't setup the
port link in the subsequent test.

Add record for this verification and raise exception for the verify
failure to restore the link.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 tests/TestSuite_userspace_ethtool.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 2d2199c..eccc77b 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -45,6 +45,7 @@ from etgen import IxiaPacketGenerator
 from settings import HEADER_SIZE
 from settings import SCAPY2IXIA
 from utils import RED
+from exception import VerifyFailure
 
 
 class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
@@ -256,6 +257,8 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         self.dut.send_expect(self.cmd, "EthApp>", 60)
         # ethtool doesn't support port disconnect by tools of linux 
         # only detect physical link disconnect status
+        verify_pass = True
+        verify_msg = ''
         if self.nic.startswith("fortville") == False:  
             # check link status dump function
             for port in self.ports:
@@ -273,8 +276,14 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
                 if m:
                     port = m.group(1)
                     status = m.group(2)
-                    self.verify(status == "Down", "Userspace tool failed to detect link down")
-    
+                    # record link down verification result
+                    # then continue the test to restore ports link
+                    try:
+                        self.verify(status == "Down", "Userspace tool failed to detect port %s link down" % port)
+                    except VerifyFailure as v:
+                        verify_msg += str(v)
+                        verify_pass = False
+
             for port in self.ports:
                 tester_port = self.tester.get_local_port(port)
                 intf = self.tester.get_interface(tester_port)
@@ -294,6 +303,9 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             self.verify((rx_pkts == (ori_rx_pkts + 1)), "Failed to record Rx/Tx packets")
 
         self.dut.send_expect("quit", "# ")
+        # Check port link down verification result
+        if verify_pass == False:
+            raise VerifyFailure(verify_msg)
 
     def test_retrieve_reg(self):
         """
-- 
2.7.4

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

* Re: [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link
  2018-06-15  8:58 [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link Phil Yang
@ 2018-06-20 15:08 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2018-06-20 15:08 UTC (permalink / raw)
  To: dts-bounces, dts; +Cc: nd, phil.yang

Thanks, Phil. Applied.

On 06/15/2018 04:58 PM, dts-bounces@dpdk.org wrote:
> Test Case test_dump_driver_info will set ip link down to get the port
> link down status. If verification is failed, it won't setup the
> port link in the subsequent test.
>
> Add record for this verification and raise exception for the verify
> failure to restore the link.
>
> Signed-off-by: Phil Yang<phil.yang@arm.com>
> ---

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

end of thread, other threads:[~2018-06-20  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15  8:58 [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link Phil Yang
2018-06-20 15:08 ` Liu, Yong

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).