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 13F1EA0C41; Mon, 2 Aug 2021 09:28:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E478A40143; Mon, 2 Aug 2021 09:28:27 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A787440140 for ; Mon, 2 Aug 2021 09:28:26 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10063"; a="213392674" X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="213392674" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 00:28:24 -0700 X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="478637239" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 00:28:23 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Date: Mon, 2 Aug 2021 15:20:53 +0800 Message-Id: <20210802072053.2520960-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V2] tests/virtio_event_idx_interrupt: optimize the code 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 Sender: "dts" v1: Add bind_dev parameter to replace restore_interfaces in start_vm method to decide bind the NIC port to dpdk in vm or not. v2: Add set_target parameter because this suite no need build dpdk in vm. Signed-off-by: Wei Ling --- tests/TestSuite_virtio_event_idx_interrupt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_virtio_event_idx_interrupt.py b/tests/TestSuite_virtio_event_idx_interrupt.py index 37634f05..041658e9 100644 --- a/tests/TestSuite_virtio_event_idx_interrupt.py +++ b/tests/TestSuite_virtio_event_idx_interrupt.py @@ -134,7 +134,7 @@ class TestVirtioIdxInterrupt(TestCase): self.vhost.send_expect(command_line, "testpmd> ", 30) self.vhost.send_expect("start", "testpmd> ", 30) - def start_vms(self, packed=False, mode=False): + def start_vms(self, packed=False, mode=False, set_target=False, bind_dev=False): """ start qemus """ @@ -155,12 +155,11 @@ class TestVirtioIdxInterrupt(TestCase): vm_params['opt_settings'] = opt_args self.vm.set_vm_device(**vm_params) try: - self.vm_dut = self.vm.start() + self.vm_dut = self.vm.start(set_target=set_target, bind_dev=bind_dev) if self.vm_dut is None: raise Exception("Set up VM ENV failed") except Exception as e: self.logger.error("ERROR: Failure for %s" % str(e)) - self.vm_dut.restore_interfaces() def config_virito_net_in_vm(self): """ -- 2.25.1