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 C2036A00C5; Tue, 7 Jul 2020 07:39:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 442F11DA7E; Tue, 7 Jul 2020 07:39:38 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 75CBC1C238 for ; Tue, 7 Jul 2020 07:39:36 +0200 (CEST) IronPort-SDR: 4+iQ5f03XCOb8RQ/xZK5i/rmjTz2IB9yfuf8zDBUmbGcEVJJ6QBz5vSmdXioR9Ba20PFxWD3TF TRQjJUN3VIug== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="146616565" X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="146616565" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 22:39:35 -0700 IronPort-SDR: IREgX7iT34c6W8MeG5B3uSqwE3Zk1B1U7PdHrurpByoH/4vLRB4EJ3GKVRGc9OSgOOPWmL4hSZ RVD1NV0evbag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="297279991" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.208]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2020 22:39:34 -0700 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Tue, 7 Jul 2020 13:38:54 +0800 Message-Id: <20200707053854.13787-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200707053854.13787-1-yufengx.mo@intel.com> References: <20200707053854.13787-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue 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" #. fix port release issue. Signed-off-by: yufengmx --- tests/TestSuite_power_branch_ratio.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_power_branch_ratio.py b/tests/TestSuite_power_branch_ratio.py index 8bd82d4..b45ebcb 100644 --- a/tests/TestSuite_power_branch_ratio.py +++ b/tests/TestSuite_power_branch_ratio.py @@ -303,10 +303,12 @@ class TestPowerBranchRatio(TestCase): self.dut.build_install_dpdk(self.target) @contextmanager - def restore_compilation(self): + def restore_environment(self): try: yield finally: + time.sleep(10) + self.restore_port_drv() sw_table = [ "CONFIG_RTE_LIBRTE_POWER", "CONFIG_RTE_LIBRTE_POWER_DEBUG", @@ -319,6 +321,17 @@ class TestPowerBranchRatio(TestCase): # re-compile dpdk source code self.dut.build_install_dpdk(self.target) + def restore_port_drv(self): + driver = self.drivername + for port in self.dut.ports_info: + netdev = port.get('port') + if not netdev: + continue + cur_drv = netdev.get_nic_driver() + if cur_drv == driver: + continue + netdev.bind_driver(driver) + def init_vm_power_mgr(self): self.vm_power_mgr = self.prepare_binary('vm_power_manager') @@ -652,7 +665,7 @@ class TestPowerBranchRatio(TestCase): """ Run after each test suite. """ - with self.restore_compilation(): + with self.restore_environment(): self.close_vm() def set_up(self): -- 2.21.0