@@ -5377,56 +5377,6 @@ def test_populate_instance_names_host_name_is_empty_multi(self):
5377
5377
self .compute_api ._populate_instance_names (instance , 2 , 1 )
5378
5378
self .assertEqual ('Server-%s' % instance .uuid , instance .hostname )
5379
5379
5380
- def test_host_statuses (self ):
5381
- instances = [
5382
- objects .Instance (uuid = uuids .instance_1 , host = 'host1' , services =
5383
- self ._obj_to_list_obj (objects .ServiceList (
5384
- self .context ), objects .Service (id = 0 , host = 'host1' ,
5385
- disabled = True , forced_down = True ,
5386
- binary = 'nova-compute' ))),
5387
- objects .Instance (uuid = uuids .instance_2 , host = 'host2' , services =
5388
- self ._obj_to_list_obj (objects .ServiceList (
5389
- self .context ), objects .Service (id = 0 , host = 'host2' ,
5390
- disabled = True , forced_down = False ,
5391
- binary = 'nova-compute' ))),
5392
- objects .Instance (uuid = uuids .instance_3 , host = 'host3' , services =
5393
- self ._obj_to_list_obj (objects .ServiceList (
5394
- self .context ), objects .Service (id = 0 , host = 'host3' ,
5395
- disabled = False , last_seen_up = timeutils .utcnow ()
5396
- - datetime .timedelta (minutes = 5 ),
5397
- forced_down = False , binary = 'nova-compute' ))),
5398
- objects .Instance (uuid = uuids .instance_4 , host = 'host4' , services =
5399
- self ._obj_to_list_obj (objects .ServiceList (
5400
- self .context ), objects .Service (id = 0 , host = 'host4' ,
5401
- disabled = False , last_seen_up = timeutils .utcnow (),
5402
- forced_down = False , binary = 'nova-compute' ))),
5403
- objects .Instance (uuid = uuids .instance_5 , host = 'host5' , services =
5404
- objects .ServiceList ()),
5405
- objects .Instance (uuid = uuids .instance_6 , host = None , services =
5406
- self ._obj_to_list_obj (objects .ServiceList (
5407
- self .context ), objects .Service (id = 0 , host = 'host6' ,
5408
- disabled = True , forced_down = False ,
5409
- binary = 'nova-compute' ))),
5410
- objects .Instance (uuid = uuids .instance_7 , host = 'host2' , services =
5411
- self ._obj_to_list_obj (objects .ServiceList (
5412
- self .context ), objects .Service (id = 0 , host = 'host2' ,
5413
- disabled = True , forced_down = False ,
5414
- binary = 'nova-compute' )))
5415
- ]
5416
-
5417
- host_statuses = self .compute_api .get_instances_host_statuses (
5418
- instances )
5419
- expect_statuses = {uuids .instance_1 : fields_obj .HostStatus .DOWN ,
5420
- uuids .instance_2 : fields_obj .HostStatus .MAINTENANCE ,
5421
- uuids .instance_3 : fields_obj .HostStatus .UNKNOWN ,
5422
- uuids .instance_4 : fields_obj .HostStatus .UP ,
5423
- uuids .instance_5 : fields_obj .HostStatus .NONE ,
5424
- uuids .instance_6 : fields_obj .HostStatus .NONE ,
5425
- uuids .instance_7 : fields_obj .HostStatus .MAINTENANCE }
5426
- for instance in instances :
5427
- self .assertEqual (expect_statuses [instance .uuid ],
5428
- host_statuses [instance .uuid ])
5429
-
5430
5380
@mock .patch .object (objects .Migration , 'get_by_id_and_instance' )
5431
5381
@mock .patch .object (objects .InstanceAction , 'action_start' )
5432
5382
def test_live_migrate_force_complete_succeeded (
0 commit comments