From ff28df4ba7f642042e2feed359ffbfa71946a8a2 Mon Sep 17 00:00:00 2001 From: Yun Mao Date: Tue, 5 Jun 2012 14:55:34 -0400 Subject: [PATCH] vm state and task state management partially implements bp task-management fixes bug 997867 also see http://wiki.openstack.org/VMState Refactored the following API/state: * rebuild * migrate * resize * start * stop * delete * soft delete * rework sync_power_state in compute/manager. fix broken tests, add transition diagram in dot Change-Id: I3c5a97508a6dad7175fba12828bd3fa6ef1e50ee --- nova/tests/test_imagecache.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nova/tests/test_imagecache.py b/nova/tests/test_imagecache.py index 4b1b5dac..43ee7ed9 100644 --- a/nova/tests/test_imagecache.py +++ b/nova/tests/test_imagecache.py @@ -26,7 +26,7 @@ import time from nova import test -from nova.compute import task_states +from nova.compute import vm_states from nova import db from nova import flags from nova import log @@ -150,16 +150,19 @@ class ImageCacheManagerTestCase(test.TestCase): 'host': FLAGS.host, 'name': 'inst-1', 'uuid': '123', + 'vm_state': '', 'task_state': ''}, {'image_ref': '2', 'host': FLAGS.host, 'name': 'inst-2', 'uuid': '456', + 'vm_state': '', 'task_state': ''}, {'image_ref': '2', 'host': 'remotehost', 'name': 'inst-3', 'uuid': '789', + 'vm_state': '', 'task_state': ''}]) image_cache_manager = imagecache.ImageCacheManager() @@ -183,7 +186,8 @@ class ImageCacheManagerTestCase(test.TestCase): 'host': FLAGS.host, 'name': 'inst-1', 'uuid': '123', - 'task_state': task_states.RESIZE_VERIFY}]) + 'vm_state': vm_states.RESIZED, + 'task_state': None}]) image_cache_manager = imagecache.ImageCacheManager() image_cache_manager._list_running_instances(None) @@ -766,11 +770,13 @@ class ImageCacheManagerTestCase(test.TestCase): 'host': FLAGS.host, 'name': 'instance-1', 'uuid': '123', + 'vm_state': '', 'task_state': ''}, {'image_ref': '1', 'host': FLAGS.host, 'name': 'instance-2', 'uuid': '456', + 'vm_state': '', 'task_state': ''}]) image_cache_manager = imagecache.ImageCacheManager() @@ -865,11 +871,13 @@ class ImageCacheManagerTestCase(test.TestCase): 'host': FLAGS.host, 'name': 'instance-1', 'uuid': '123', + 'vm_state': '', 'task_state': ''}, {'image_ref': '1', 'host': FLAGS.host, 'name': 'instance-2', 'uuid': '456', + 'vm_state': '', 'task_state': ''}]) def touch(filename):