[V1] tests/vm_power_manager:restart libvirtd

Message ID 20211018190436.12097-1-leweix.yang@intel.com (mailing list archive)
State Changes Requested
Headers
Series [V1] tests/vm_power_manager:restart libvirtd |

Checks

Context Check Description
ci/Intel-dts-suite-test warning SKIPPED

Commit Message

Lewei Yang Oct. 18, 2021, 7:04 p.m. UTC
  dut needs to create a new vm,but a suite has created a vm before.
restart libvirtd to make sure new vm can be created 

Signed-off-by: Lewei Yang <leweix.yang@intel.com>
---
 tests/TestSuite_vm_power_manager.py | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Tu, Lijuan Oct. 25, 2021, 3:34 a.m. UTC | #1
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Lewei Yang
> Sent: 2021年10月19日 3:05
> To: dts@dpdk.org
> Cc: Yang, LeweiX <leweix.yang@intel.com>
> Subject: [dts] [PATCH V1] tests/vm_power_manager:restart libvirtd
> 
> dut needs to create a new vm,but a suite has created a vm before.
> restart libvirtd to make sure new vm can be created
> 
> Signed-off-by: Lewei Yang <leweix.yang@intel.com>
> ---
>  tests/TestSuite_vm_power_manager.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/TestSuite_vm_power_manager.py
> b/tests/TestSuite_vm_power_manager.py
> index f650ba28..455383f7 100644
> --- a/tests/TestSuite_vm_power_manager.py
> +++ b/tests/TestSuite_vm_power_manager.py
> @@ -63,6 +63,7 @@ class TestVmPowerManager(TestCase):
>          self.vcpu_map = []
>          # start vm
>          self.vm_name = "vm0"
> +        self.dut.send_expect("service libvirtd restart", "# ")

It's real a bad idea to restart service. Libvirt should have the cap to create a new vm.

>          self.vm = LibvirtKvm(self.dut, self.vm_name, self.suite_name)
>          channels = [
>              {'path': '/tmp/powermonitor/%s.0' %
> --
> 2.17.1
  

Patch

diff --git a/tests/TestSuite_vm_power_manager.py b/tests/TestSuite_vm_power_manager.py
index f650ba28..455383f7 100644
--- a/tests/TestSuite_vm_power_manager.py
+++ b/tests/TestSuite_vm_power_manager.py
@@ -63,6 +63,7 @@  class TestVmPowerManager(TestCase):
         self.vcpu_map = []
         # start vm
         self.vm_name = "vm0"
+        self.dut.send_expect("service libvirtd restart", "# ")
         self.vm = LibvirtKvm(self.dut, self.vm_name, self.suite_name)
         channels = [
             {'path': '/tmp/powermonitor/%s.0' %