From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D2CDBC44A for ; Thu, 30 Jul 2015 09:16:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 30 Jul 2015 00:16:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,575,1432623600"; d="scan'208";a="774302252" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 30 Jul 2015 00:16:42 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t6U7GcHQ003796; Thu, 30 Jul 2015 15:16:38 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t6U7Gajr019350; Thu, 30 Jul 2015 15:16:38 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t6U7GadG019346; Thu, 30 Jul 2015 15:16:36 +0800 From: Yong Liu To: dts@dpdk.org Date: Thu, 30 Jul 2015 15:16:35 +0800 Message-Id: <1438240595-19314-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH] Move vm dut close and log exit function from suite to virt_base module 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: Thu, 30 Jul 2015 07:16:43 -0000 From: Marvin Liu Signed-off-by: Marvin Liu diff --git a/framework/virt_base.py b/framework/virt_base.py index d0dfa1c..2cbb10d 100644 --- a/framework/virt_base.py +++ b/framework/virt_base.py @@ -355,6 +355,8 @@ class VirtBase(object): Stop the VM. """ self.vm_dut.close() + self.vm_dut.logger.logger_exit() + self.vm_dut = None self._stop_vm() self.virt_pool.free_all_resource(self.vm_name) diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py index 8109840..cd3d9c3 100644 --- a/tests/TestSuite_sriov_kvm.py +++ b/tests/TestSuite_sriov_kvm.py @@ -307,14 +307,10 @@ class TestSriovKvm(TestCase): self.setup_2vm_2vf_env_flag = 1 def destroy_2vm_2pf_env(self): - self.vm_dut_0.close() - self.vm_dut_0.logger.logger_exit() self.vm0.stop() self.port0.bind_driver('igb_uio') self.vm0 = None - self.vm_dut_1.close() - self.vm_dut_1.logger.logger_exit() self.vm1.stop() self.port1.bind_driver('igb_uio') self.vm1 = None @@ -373,16 +369,10 @@ class TestSriovKvm(TestCase): raise Exception(e) def destroy_2vm_2vf_env(self): - if getattr(self, 'vm_dut_0', None): - self.vm_dut_0.close() - self.vm_dut_0.logger.logger_exit() if getattr(self, 'vm0', None): self.vm0.stop() self.vm0 = None - if getattr(self, 'vm_dut_1', None): - self.vm_dut_1.close() - self.vm_dut_1.logger.logger_exit() if getattr(self, 'vm1', None): self.vm1.stop() self.vm1 = None @@ -468,30 +458,18 @@ class TestSriovKvm(TestCase): raise Exception(e) def destroy_4vm_4vf_env(self): - if getattr(self, 'vm_dut_0', None): - self.vm_dut_0.close() - self.vm_dut_0.logger.logger_exit() if getattr(self, 'vm0', None): self.vm0.stop() self.vm0 = None - if getattr(self, 'vm_dut_1', None): - self.vm_dut_1.close() - self.vm_dut_1.logger.logger_exit() if getattr(self, 'vm1', None): self.vm1.stop() self.vm1 = None - if getattr(self, 'vm_dut_2', None): - self.vm_dut_2.close() - self.vm_dut_2.logger.logger_exit() if getattr(self, 'vm2', None): self.vm2.stop() self.vm2 = None - if getattr(self, 'vm_dut_3', None): - self.vm_dut_3.close() - self.vm_dut_3.logger.logger_exit() if getattr(slef, 'vm3', None): self.vm3.stop() self.vm3 = None diff --git a/tests/TestSuite_vhost_cuse_sample.py b/tests/TestSuite_vhost_cuse_sample.py index 161700b..7666d2f 100644 --- a/tests/TestSuite_vhost_cuse_sample.py +++ b/tests/TestSuite_vhost_cuse_sample.py @@ -217,9 +217,6 @@ class TestVhostCUSESample(TestCase, IxiaPacketGenerator): if self.vm_dut: self.vm_dut.kill_all() time.sleep(1) - self.vm_dut.close() - self.vm_dut.logger.logger_exit() - self.vm_dut = None if self.vm: self.vm.stop() self.vm = None diff --git a/tests/TestSuite_vhost_sample.py b/tests/TestSuite_vhost_sample.py index f148bb4..32e47ad 100644 --- a/tests/TestSuite_vhost_sample.py +++ b/tests/TestSuite_vhost_sample.py @@ -197,9 +197,6 @@ class TestVhostSample(TestCase, IxiaPacketGenerator): if self.vm_dut: self.vm_dut.kill_all() time.sleep(1) - self.vm_dut.close() - self.vm_dut.logger.logger_exit() - self.vm_dut = None if self.vm: self.vm.stop() self.vm = None diff --git a/tests/TestSuite_vxlan_sample.py b/tests/TestSuite_vxlan_sample.py index 17ebefe..db40a96 100644 --- a/tests/TestSuite_vxlan_sample.py +++ b/tests/TestSuite_vxlan_sample.py @@ -231,9 +231,6 @@ class TestVxlanSample(TestCase): if self.vm_dut: self.vm_dut.kill_all() time.sleep(1) - self.vm_dut.close() - self.vm_dut.logger.logger_exit() - self.vm_dut = None if self.vm: self.vm.stop() -- 1.9.3