From af2acabe35f91d0bdd2b2c921f23d6828e480a20 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Wed, 9 Nov 2011 10:06:52 -0500 Subject: Converting rebuild to use instance objects. Related to blueprint internal-uuids Change-Id: If8a708a78ab017a4d807bf14542b3ab093d2e026 --- nova/tests/test_compute.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 29269620c..021c75ed0 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -343,6 +343,22 @@ class ComputeTestCase(test.TestCase): self.compute.resume_instance(self.context, instance_id) self.compute.terminate_instance(self.context, instance_id) + def test_rebuild(self): + instance_id = self._create_instance() + self.compute.run_instance(self.context, instance_id) + + instance = db.instance_get(self.context, instance_id) + self.assertEqual(instance['task_state'], None) + + image_ref = instance["image_ref"] + password = "new_password" + self.compute_api.rebuild(self.context, instance, image_ref, password) + + instance = db.instance_get(self.context, instance_id) + self.assertEqual(instance['task_state'], task_states.REBUILDING) + + db.instance_destroy(self.context, instance_id) + def test_reboot_soft_api(self): """Ensure instance can be soft rebooted""" instance_id = self._create_instance() -- cgit