From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id AC0D21D71F for ; Fri, 15 Jun 2018 10:59:11 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 98DF880D; Fri, 15 Jun 2018 01:59:10 -0700 (PDT) Received: from phil-VirtualBox.shanghai.arm.com (unknown [10.169.106.157]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7FEB03F557; Fri, 15 Jun 2018 01:59:09 -0700 (PDT) From: Phil Yang To: dts@dpdk.org Cc: nd@arm.com, phil.yang@arm.com Date: Fri, 15 Jun 2018 16:58:58 +0800 Message-Id: <1529053138-20999-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH] tests/userspace_ethtool: fix link down verify failure destroyed ports link X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 08:59:12 -0000 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 --- 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