* [dts] [PATCH] Move vm dut close and log exit function from suite to virt_base module
@ 2015-07-30 7:16 Yong Liu
0 siblings, 0 replies; only message in thread
From: Yong Liu @ 2015-07-30 7:16 UTC (permalink / raw)
To: dts
From: Marvin Liu <yong.liu@intel.com>
Signed-off-by: Marvin Liu <yong.liu@intel.com>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-30 7:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 7:16 [dts] [PATCH] Move vm dut close and log exit function from suite to virt_base module Yong Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).