Cleans up power_off and power_on semantics

compute.api changes:
  * improves state handling for delete/restrore
  * removes hack to deal with SHUTOFF on start
  * fixes api tests (volume shouldn't detach on stop)

compute.manager changes:
  * uses power_off/power_on for stop/start

virt.libvirt changes:
  * implements power_off/power_on for libvirt
  * synchronizes usage of domain.create()
  * cleans up usage of instance.name
  * added tests for power_on and power_off
  * fixes bug 1006950

Change-Id: I91845a643e3f97955e7c81ca57c6ee5aa0a3d295
This commit is contained in:
Vishvananda Ishaya
2012-06-01 02:52:57 +00:00
parent cc3b912d76
commit 249cd66433

View File

@@ -176,6 +176,22 @@ class _VirtDriverTestCase(test.TestCase):
self.ctxt, instance_ref, 'dest_host', instance_type_ref, self.ctxt, instance_ref, 'dest_host', instance_type_ref,
network_info) network_info)
@catch_notimplementederror
def test_power_off(self):
instance_ref, network_info = self._get_running_instance()
self.connection.power_off(instance_ref)
@catch_notimplementederror
def test_test_power_on_running(self):
instance_ref, network_info = self._get_running_instance()
self.connection.power_on(instance_ref)
@catch_notimplementederror
def test_test_power_on_powered_off(self):
instance_ref, network_info = self._get_running_instance()
self.connection.power_off(instance_ref)
self.connection.power_on(instance_ref)
@catch_notimplementederror @catch_notimplementederror
def test_pause(self): def test_pause(self):
instance_ref, network_info = self._get_running_instance() instance_ref, network_info = self._get_running_instance()