test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] Move vm dut close and log exit function from suite to virt_base module
Date: Thu, 30 Jul 2015 15:16:35 +0800	[thread overview]
Message-ID: <1438240595-19314-1-git-send-email-yong.liu@intel.com> (raw)

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

                 reply	other threads:[~2015-07-30  7:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438240595-19314-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).