rest api version bumped for async pre live migration checks
pre live-migration checks now are done in async way. This patch updates rest api version to keep this tracked. bp: async-live-migration-rest-check Change-Id: I9fed3079d0f1b7de3ad1b3ecd309c93785fd11fe
This commit is contained in:
@@ -33,6 +33,7 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
_api_version = '2.1'
|
||||
disk_over_commit = False
|
||||
force = None
|
||||
async = False
|
||||
|
||||
def setUp(self):
|
||||
super(MigrateServerTestsV21, self).setUp()
|
||||
@@ -59,7 +60,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
'_migrate_live': 'live_migrate'}
|
||||
body_map = {'_migrate_live': self._get_migration_body(host='hostname')}
|
||||
args_map = {'_migrate_live': ((False, self.disk_over_commit,
|
||||
'hostname', self.force), {})}
|
||||
'hostname', self.force, self.async),
|
||||
{})}
|
||||
self._test_actions(['_migrate', '_migrate_live'], body_map=body_map,
|
||||
method_translations=method_translations,
|
||||
args_map=args_map)
|
||||
@@ -69,7 +71,7 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
'_migrate_live': 'live_migrate'}
|
||||
body_map = {'_migrate_live': self._get_migration_body(host=None)}
|
||||
args_map = {'_migrate_live': ((False, self.disk_over_commit, None,
|
||||
self.force),
|
||||
self.force, self.async),
|
||||
{})}
|
||||
self._test_actions(['_migrate', '_migrate_live'], body_map=body_map,
|
||||
method_translations=method_translations,
|
||||
@@ -85,7 +87,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
'_migrate_live': 'live_migrate'}
|
||||
body_map = self._get_migration_body(host='hostname')
|
||||
args_map = {'_migrate_live': ((False, self.disk_over_commit,
|
||||
'hostname', self.force), {})}
|
||||
'hostname', self.force, self.async),
|
||||
{})}
|
||||
exception_arg = {'_migrate': 'migrate',
|
||||
'_migrate_live': 'os-migrateLive'}
|
||||
self._test_actions_raise_conflict_on_invalid_state(
|
||||
@@ -100,7 +103,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
body_map = {'_migrate_live':
|
||||
self._get_migration_body(host='hostname')}
|
||||
args_map = {'_migrate_live': ((False, self.disk_over_commit,
|
||||
'hostname', self.force), {})}
|
||||
'hostname', self.force, self.async),
|
||||
{})}
|
||||
self._test_actions_with_locked_instance(
|
||||
['_migrate', '_migrate_live'], body_map=body_map,
|
||||
args_map=args_map, method_translations=method_translations)
|
||||
@@ -125,19 +129,13 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
instance = self._stub_instance_get()
|
||||
self.compute_api.live_migrate(self.context, instance, False,
|
||||
self.disk_over_commit, 'hostname',
|
||||
self.force)
|
||||
self.force, self.async)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
res = self.controller._migrate_live(self.req, instance.uuid,
|
||||
body={'os-migrateLive': param})
|
||||
# NOTE: on v2.1, http status code is set as wsgi_code of API
|
||||
# method instead of status_int in a response object.
|
||||
if self._api_version == '2.1':
|
||||
status_int = self.controller._migrate_live.wsgi_code
|
||||
else:
|
||||
status_int = res.status_int
|
||||
self.assertEqual(202, status_int)
|
||||
live_migrate_method = self.controller._migrate_live
|
||||
live_migrate_method(self.req, instance.uuid,
|
||||
body={'os-migrateLive': param})
|
||||
self.assertEqual(202, live_migrate_method.wsgi_code)
|
||||
|
||||
def test_migrate_live_enabled(self):
|
||||
param = self._get_params(host='hostname')
|
||||
@@ -204,9 +202,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
||||
instance = self._stub_instance_get(uuid=uuid)
|
||||
self.compute_api.live_migrate(self.context, instance, False,
|
||||
self.disk_over_commit,
|
||||
'hostname', self.force
|
||||
'hostname', self.force, self.async
|
||||
).AndRaise(fake_exc)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
body = self._get_migration_body(host='hostname')
|
||||
@@ -308,8 +305,8 @@ class MigrateServerTestsV225(MigrateServerTestsV21):
|
||||
method_translations = {'_migrate_live': 'live_migrate'}
|
||||
body_map = {'_migrate_live': {'os-migrateLive': {'host': 'hostname',
|
||||
'block_migration': 'auto'}}}
|
||||
args_map = {'_migrate_live': ((None, None, 'hostname', self.force),
|
||||
{})}
|
||||
args_map = {'_migrate_live': ((None, None, 'hostname', self.force,
|
||||
self.async), {})}
|
||||
self._test_actions(['_migrate_live'], body_map=body_map,
|
||||
method_translations=method_translations,
|
||||
args_map=args_map)
|
||||
@@ -329,7 +326,6 @@ class MigrateServerTestsV225(MigrateServerTestsV21):
|
||||
|
||||
|
||||
class MigrateServerTestsV230(MigrateServerTestsV225):
|
||||
|
||||
force = False
|
||||
|
||||
def setUp(self):
|
||||
@@ -346,8 +342,8 @@ class MigrateServerTestsV230(MigrateServerTestsV225):
|
||||
body_map = {'_migrate_live': {'os-migrateLive': {'host': 'hostname',
|
||||
'block_migration': 'auto',
|
||||
'force': litteral_force}}}
|
||||
args_map = {'_migrate_live': ((None, None, 'hostname', force),
|
||||
{})}
|
||||
args_map = {'_migrate_live': ((None, None, 'hostname', force,
|
||||
self.async), {})}
|
||||
self._test_actions(['_migrate_live'], body_map=body_map,
|
||||
method_translations=method_translations,
|
||||
args_map=args_map)
|
||||
@@ -366,6 +362,75 @@ class MigrateServerTestsV230(MigrateServerTestsV225):
|
||||
self.req, fakes.FAKE_UUID, body=body)
|
||||
|
||||
|
||||
class MigrateServerTestsV234(MigrateServerTestsV230):
|
||||
async = True
|
||||
|
||||
def setUp(self):
|
||||
super(MigrateServerTestsV230, self).setUp()
|
||||
self.req.api_version_request = api_version_request.APIVersionRequest(
|
||||
'2.34')
|
||||
|
||||
# NOTE(tdurakov): for REST API version 2.34 and above, tests below are not
|
||||
# valid, as they are made in background.
|
||||
def test_migrate_live_compute_service_unavailable(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_invalid_hypervisor_type(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_invalid_cpu_info(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_unable_to_migrate_to_self(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_destination_hypervisor_too_old(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_no_valid_host(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_invalid_local_storage(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_invalid_shared_storage(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_hypervisor_unavailable(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_instance_not_active(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_pre_check_error(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_migration_precheck_client_exception(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_migration_with_unexpected_error(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_migration_with_old_nova_not_supported(self):
|
||||
pass
|
||||
|
||||
def test_migrate_live_unexpected_error(self):
|
||||
exc = exception.NoValidHost(reason="No valid host found")
|
||||
self.mox.StubOutWithMock(self.compute_api, 'live_migrate')
|
||||
instance = self._stub_instance_get()
|
||||
self.compute_api.live_migrate(self.context, instance, None,
|
||||
self.disk_over_commit, 'hostname',
|
||||
self.force, self.async).AndRaise(exc)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
body = {'os-migrateLive':
|
||||
{'host': 'hostname', 'block_migration': 'auto'}}
|
||||
|
||||
self.assertRaises(webob.exc.HTTPInternalServerError,
|
||||
self.controller._migrate_live,
|
||||
self.req, instance.uuid, body=body)
|
||||
|
||||
|
||||
class MigrateServerPolicyEnforcementV21(test.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user