diff --git a/nova/tests/fakelibvirt.py b/nova/tests/fakelibvirt.py index 309a6f10f..81f946f4d 100644 --- a/nova/tests/fakelibvirt.py +++ b/nova/tests/fakelibvirt.py @@ -288,8 +288,12 @@ class Domain(object): def suspend(self): self._state = VIR_DOMAIN_PAUSED + def shutdown(self): + self._state = VIR_DOMAIN_SHUTDOWN + self._connection._mark_not_running(self) + def info(self): - return [VIR_DOMAIN_RUNNING, + return [self._state, long(self._def['memory']), long(self._def['memory']), self._def['vcpu'], diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py index 5b5b7d42e..8018008a6 100644 --- a/nova/tests/test_virt_drivers.py +++ b/nova/tests/test_virt_drivers.py @@ -476,6 +476,10 @@ class LibvirtConnTestCase(_VirtDriverTestCase): nova.virt.libvirt.firewall.libvirt = self.saved_libvirt super(LibvirtConnTestCase, self).tearDown() + def test_force_hard_reboot(self): + self.flags(libvirt_wait_soft_reboot_seconds=0) + self.test_reboot() + @test.skip_test("Test nothing, but this method " "needed to override superclass.") def test_migrate_disk_and_power_off(self):