summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2015-07-30 15:16:35 +0800
committerMarvin Liu <yong.liu@intel.com>2015-08-04 13:05:54 +0800
commit170f0d693a5656e99928cb8c72192aafaa6cbceb (patch)
treec729713c6553c8cabf8f5ef4decc6114db53d4fc
parent459559fe16e2c37775274807a334b73a47474b42 (diff)
downloaddts-170f0d693a5656e99928cb8c72192aafaa6cbceb.zip
dts-170f0d693a5656e99928cb8c72192aafaa6cbceb.tar.gz
dts-170f0d693a5656e99928cb8c72192aafaa6cbceb.tar.xz
Move vm dut close and log exit function from suite to virt_base module
Signed-off-by: Marvin Liu <yong.liu@intel.com>
-rw-r--r--framework/virt_base.py2
-rw-r--r--tests/TestSuite_sriov_kvm.py22
-rw-r--r--tests/TestSuite_vhost_cuse_sample.py3
-rw-r--r--tests/TestSuite_vhost_sample.py3
-rw-r--r--tests/TestSuite_vxlan_sample.py3
5 files changed, 2 insertions, 31 deletions
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()