From cdbe847d29cb077f18913c981459d6b923dc458a Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 22 Dec 2016 15:20:54 +0530 Subject: [PATCH] CLOUDSTACK-9688: Fix failing test_volumes on centos7/kvm Due to OS/hypervisor/environmental configuration, detaching a disk/device using libvirt can be successful without updating the domain configuration (xml). This leads to reattachment failure as the device is blocked until the next reboot. This fixes a specific environment case by performing stop/start on the VM only in case of KVM, which will recreate a fresh domain config (xml) as KVM VMs have transient domain configs (xmls don't persist). Signed-off-by: Rohit Yadav --- test/integration/smoke/test_volumes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 4dcf26387ad..28087b11262 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -378,6 +378,11 @@ class TestVolumes(cloudstackTestCase): #Clean up, terminate the created volumes if self.attached: self.virtual_machine.detach_volume(self.apiClient, self.volume) + + if self.virtual_machine.hypervisor == "KVM": + self.virtual_machine.stop(self.apiClient) + self.virtual_machine.start(self.apiClient) + cleanup_resources(self.apiClient, self.cleanup) return