[dts] [PATCH V1] tests/TestSuite_shutdown_api:Modify the execution order of shutting down the VM environment

Zhang, XiX xix.zhang at intel.com
Fri Jul 3 05:10:03 CEST 2020


Tested-by: xizhan4x <xix.zhang at intel.com>

-----Original Message-----
From: Zhang, XiX 
Sent: Friday, July 3, 2020 11:08 AM
To: dts at dpdk.org
Cc: Zhang, XiX <xix.zhang at intel.com>
Subject: [dts][PATCH V1] tests/TestSuite_shutdown_api:Modify the execution order of shutting down the VM environment

Modify the execution order of shutting down the VM environment, The correct step should be to shut down the VM environment before unbind Vf


Signed-off-by: xizhan4x <xix.zhang at intel.com>
---
 tests/TestSuite_shutdown_api.py | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 650ccfc..9fc3e3a 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -296,6 +296,16 @@ class TestShutdownApi(TestCase):
 
 
     def destroy_vm_env(self):
+        if getattr(self, 'self.vm0_testpmd', None):
+            self.vm0_testpmd.quit()
+
+        if getattr(self, 'vm0', None):
+            if getattr(self, 'vm0_dut', None):
+                self.vm0_dut.kill_all()
+            self.vm0_testpmd = None
+            self.vm0_dut_ports = None
+            # destroy vm0
+            self.vm0.stop()
         if getattr(self, 'used_dut_port', None) is not None:
             self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
             self.used_dut_port = None
@@ -308,18 +318,11 @@ class TestShutdownApi(TestCase):
         if not self.vm_env_done:
             return
 
-        if getattr(self, 'self.vm0_testpmd', None):
-            self.vm0_testpmd.quit()
-
-        if getattr(self, 'vm0', None):
-            if getattr(self, 'vm0_dut', None):
-                self.vm0_dut.kill_all()
-            self.vm0_testpmd = None
-            self.vm0_dut_ports = None
-            # destroy vm0
-            self.vm0.stop()
         self.vm_env_done = False
 
+
+
+
     def test_stop_restart(self):
         """
         Stop and Restar.
--
1.8.3.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestShutdownApi.log
Type: application/octet-stream
Size: 161678 bytes
Desc: TestShutdownApi.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20200703/5bec5882/attachment.obj>


More information about the dts mailing list