From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7798EA0519; Fri, 3 Jul 2020 05:07:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31AF01D6B3; Fri, 3 Jul 2020 05:07:28 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3449E1D668 for ; Fri, 3 Jul 2020 05:07:25 +0200 (CEST) IronPort-SDR: JSd42JKyB4AONg9KBJjnklQjh6hADzq6f/3ojBPEhXdjLz6Q0Lj61lQq4qQP9yq/5/bzQzP213 CKGS8IhxPI6Q== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="144600916" X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="144600916" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 20:07:24 -0700 IronPort-SDR: RklRWV+GVkOWxT/HHhcO9wDEd2NJOqomIQqfO4VUjYLrTRO5j7CfkUj8K7F/GBBr+0Z5cbHeJX PuVTPp3C2xGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="296086091" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.182.150]) by orsmga002.jf.intel.com with ESMTP; 02 Jul 2020 20:07:23 -0700 From: xizhan4x To: dts@dpdk.org Cc: xizhan4x Date: Fri, 3 Jul 2020 11:07:39 +0800 Message-Id: <1593745659-29077-1-git-send-email-xix.zhang@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] tests/TestSuite_shutdown_api:Modify the execution order of shutting down the VM environment 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" 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 --- 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