From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CAA1EA04F7; Tue, 7 Jan 2020 04:09:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 901D81D8CA; Tue, 7 Jan 2020 04:09:50 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 3DF121D73D for ; Tue, 7 Jan 2020 04:09:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 19:09:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,404,1571727600"; d="scan'208";a="225578852" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by fmsmga001.fm.intel.com with ESMTP; 06 Jan 2020 19:09:45 -0800 From: xuhailin To: dts@dpdk.org Cc: "xu,hailin" Date: Tue, 7 Jan 2020 10:59:19 +0800 Message-Id: <1578365959-76061-1-git-send-email-hailinx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH v1]tests/userspace_ethtool: optimize code 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" From: "xu,hailin" On some platforms, the port not up,add check port link status to make sure port link up Signed-off-by: xu,hailin --- 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