test suite reviews and discussions
 help / color / mirror / Atom feed
From: Phil Yang <phil.yang@arm.com>
To: dts@dpdk.org
Cc: nd@arm.com, phil.yang@arm.com
Subject: [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link
Date: Fri, 15 Jun 2018 16:58:58 +0800	[thread overview]
Message-ID: <1529053138-20999-1-git-send-email-phil.yang@arm.com> (raw)

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

             reply	other threads:[~2018-06-15  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15  8:58 Phil Yang [this message]
2018-06-20 15:08 ` Liu, Yong

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=1529053138-20999-1-git-send-email-phil.yang@arm.com \
    --to=phil.yang@arm.com \
    --cc=dts@dpdk.org \
    --cc=nd@arm.com \
    /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).