summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-12-02 11:36:38 -0500
committerAlex Meade <alex.meade@rackspace.com>2011-12-02 11:37:26 -0500
commit91cfa62b4a09cafa8af0772c68d36de9216dc440 (patch)
treed9e9498f2ab69e8e12c3b0e422b3dd78a3636a82 /nova/tests
parent7fc79c41e9759310faf5a88f28981f0efb53d431 (diff)
EC2 rescue/unrescue is broken, bug 899225
Change-Id: I5a0b9c08a43e8c606d1c885cf7f47382fa4664a8
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/ec2/test_cloud.py29
-rw-r--r--nova/tests/test_virt_drivers.py4
2 files changed, 31 insertions, 2 deletions
diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py
index 47100b7be..c206f070f 100644
--- a/nova/tests/api/ec2/test_cloud.py
+++ b/nova/tests/api/ec2/test_cloud.py
@@ -1376,6 +1376,35 @@ class CloudTestCase(test.TestCase):
else:
self.compute = self.start_service('compute')
+ def test_rescue_instances(self):
+ kwargs = {'image_id': 'ami-1',
+ 'instance_type': FLAGS.default_instance_type,
+ 'max_count': 1, }
+ instance_id = self._run_instance(**kwargs)
+
+ result = self.cloud.stop_instances(self.context, [instance_id])
+ self.assertTrue(result)
+
+ result = self.cloud.rescue_instance(self.context, instance_id)
+ self.assertTrue(result)
+
+ result = self.cloud.terminate_instances(self.context, [instance_id])
+ self.assertTrue(result)
+ self._restart_compute_service()
+
+ def test_unrescue_instances(self):
+ kwargs = {'image_id': 'ami-1',
+ 'instance_type': FLAGS.default_instance_type,
+ 'max_count': 1, }
+ instance_id = self._run_instance(**kwargs)
+
+ result = self.cloud.unrescue_instance(self.context, instance_id)
+ self.assertTrue(result)
+
+ result = self.cloud.terminate_instances(self.context, [instance_id])
+ self.assertTrue(result)
+ self._restart_compute_service()
+
def test_stop_start_instance(self):
"""Makes sure stop/start instance works"""
# enforce periodic tasks run in short time to avoid wait for 60s.
diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py
index 137d6c9ca..8b4fa177f 100644
--- a/nova/tests/test_virt_drivers.py
+++ b/nova/tests/test_virt_drivers.py
@@ -145,7 +145,7 @@ class _VirtDriverTestCase(test.TestCase):
@catch_notimplementederror
def test_rescue(self):
instance_ref, network_info = self._get_running_instance()
- self.connection.rescue(self.ctxt, instance_ref, network_info)
+ self.connection.rescue(self.ctxt, instance_ref, network_info, None)
@catch_notimplementederror
def test_unrescue_unrescued_instance(self):
@@ -155,7 +155,7 @@ class _VirtDriverTestCase(test.TestCase):
@catch_notimplementederror
def test_unrescue_rescued_instance(self):
instance_ref, network_info = self._get_running_instance()
- self.connection.rescue(self.ctxt, instance_ref, network_info)
+ self.connection.rescue(self.ctxt, instance_ref, network_info, None)
self.connection.unrescue(instance_ref, network_info)
@catch_notimplementederror