From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70DB642BCC; Mon, 29 May 2023 09:41:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C78A42B7E; Mon, 29 May 2023 09:41:30 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id DEA82410D7 for ; Mon, 29 May 2023 09:41:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685346089; x=1716882089; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=IC7/1BGrlZKEvZEzLKDXe8xsaLilSu4uihfmCDoxqk4=; b=hO0uB/VdMSm0TDq6yQMBfEmE0MnQuok9eXRXuKvTFXaYEj8/igKV+Kmk TADo9xz0HhpAJOM6ZBRTxzCAjvJqy117CpcrAjpWLhupqyYQ70XMoEUB+ +otHCNKW2eA3YDWPKgiA7yV/a6DM7of+aGdPdbEZ/8JGnrdyrr21w0NSG C3vuCeMCh1iApp2SVBF+DqzZ3kjAGCEy5zNFRL1sLbOOPmCpv219XnEia 1W7JnV75OBFKoKsQUUwBoeq/B06tgajZBbg0hMZ9tqeb01cLL6ft0ACFX t33YCY0kYfzjW2mGID36nwWTWRSxEAWuIJTrNR3FVxSsUQLVvU6T9Dzu9 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="339232561" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="339232561" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 00:41:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="705970976" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="705970976" Received: from unknown (HELO testerixgbeVF6025..) ([10.239.252.97]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 00:41:25 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li Subject: [dts][PATCH V1] tests/vf_pmd_stacked_bonded: optimize script to check link status Date: Mon, 29 May 2023 15:41:11 +0000 Message-Id: <20230529154112.84789-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Optimize the testing script to check the status of the link. If the status is down, execute the up command. Signed-off-by: Weiyuan Li --- tests/TestSuite_vf_pmd_stacked_bonded.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_vf_pmd_stacked_bonded.py b/tests/TestSuite_vf_pmd_stacked_bonded.py index 615e9517..0a5bc2be 100644 --- a/tests/TestSuite_vf_pmd_stacked_bonded.py +++ b/tests/TestSuite_vf_pmd_stacked_bonded.py @@ -403,7 +403,8 @@ class TestVFPmdStackedBonded(TestCase): self.verify("bsdapp" not in self.target, "Bonding not support freebsd") self.dut_ports = self.dut.get_ports() self.dport_info0 = self.dut.ports_info[self.dut_ports[0]] - self.dport_ifaces = self.dport_info0["intf"] + self.dport_ifaces_port0 = self.dport_info0["intf"] + self.dport_ifaces_port1 = self.dut.ports_info[self.dut_ports[1]]["intf"] num_ports = len(self.dut_ports) self.verify(num_ports == 2 or num_ports == 4, "Insufficient ports") tester_port0 = self.tester.get_local_port(self.dut_ports[0]) @@ -444,6 +445,11 @@ class TestVFPmdStackedBonded(TestCase): Run before each test case. """ self.create_vfs(pf_list=self.dut_ports, vf_num=1) + port0_stats = self.dut.is_interface_up(self.dport_ifaces_port0) + port1_stats = self.dut.is_interface_up(self.dport_ifaces_port1) + if not all([port0_stats, port1_stats]): + self.dut.send_expect(f"ip link set {self.dport_ifaces_port0} up", "# ") + self.dut.send_expect(f"ip link set {self.dport_ifaces_port1} up", "# ") self.eal_param = "" for pci in self.vfs_pci: self.eal_param += " -a %s" % pci -- 2.34.1