pull-up from trunk
This commit is contained in:
@@ -166,7 +166,7 @@ class VpnCommands(object):
|
|||||||
print address,
|
print address,
|
||||||
print vpn['host'],
|
print vpn['host'],
|
||||||
print ec2utils.id_to_ec2_id(vpn['id']),
|
print ec2utils.id_to_ec2_id(vpn['id']),
|
||||||
print vpn['state_description'],
|
print vpn['vm_state'],
|
||||||
print state
|
print state
|
||||||
else:
|
else:
|
||||||
print None
|
print None
|
||||||
@@ -869,7 +869,7 @@ class VmCommands(object):
|
|||||||
instance['hostname'],
|
instance['hostname'],
|
||||||
instance['host'],
|
instance['host'],
|
||||||
instance['instance_type'].name,
|
instance['instance_type'].name,
|
||||||
instance['state_description'],
|
instance['vm_state'],
|
||||||
instance['launched_at'],
|
instance['launched_at'],
|
||||||
instance['image_ref'],
|
instance['image_ref'],
|
||||||
instance['kernel_id'],
|
instance['kernel_id'],
|
||||||
@@ -1223,7 +1223,7 @@ class VsaCommands(object):
|
|||||||
type=vc['instance_type']['name'],
|
type=vc['instance_type']['name'],
|
||||||
fl_ip=floating_addr,
|
fl_ip=floating_addr,
|
||||||
fx_ip=fixed_addr,
|
fx_ip=fixed_addr,
|
||||||
stat=vc['state_description'],
|
stat=vc['vm_state'],
|
||||||
host=vc['host'],
|
host=vc['host'],
|
||||||
time=str(vc['created_at']))
|
time=str(vc['created_at']))
|
||||||
|
|
||||||
|
|||||||
@@ -486,8 +486,11 @@ class CloudTestCase(test.TestCase):
|
|||||||
inst2 = db.instance_create(self.context, args2)
|
inst2 = db.instance_create(self.context, args2)
|
||||||
db.instance_destroy(self.context, inst1.id)
|
db.instance_destroy(self.context, inst1.id)
|
||||||
result = self.cloud.describe_instances(self.context)
|
result = self.cloud.describe_instances(self.context)
|
||||||
result = result['reservationSet'][0]['instancesSet']
|
result1 = result['reservationSet'][0]['instancesSet']
|
||||||
self.assertEqual(result[0]['instanceId'],
|
self.assertEqual(result1[0]['instanceId'],
|
||||||
|
ec2utils.id_to_ec2_id(inst1.id))
|
||||||
|
result2 = result['reservationSet'][1]['instancesSet']
|
||||||
|
self.assertEqual(result2[0]['instanceId'],
|
||||||
ec2utils.id_to_ec2_id(inst2.id))
|
ec2utils.id_to_ec2_id(inst2.id))
|
||||||
|
|
||||||
def _block_device_mapping_create(self, instance_id, mappings):
|
def _block_device_mapping_create(self, instance_id, mappings):
|
||||||
|
|||||||
@@ -91,5 +91,7 @@ class DbApiTestCase(test.TestCase):
|
|||||||
inst2 = db.instance_create(self.context, args2)
|
inst2 = db.instance_create(self.context, args2)
|
||||||
db.instance_destroy(self.context, inst1.id)
|
db.instance_destroy(self.context, inst1.id)
|
||||||
result = db.instance_get_all_by_filters(self.context.elevated(), {})
|
result = db.instance_get_all_by_filters(self.context.elevated(), {})
|
||||||
self.assertEqual(1, len(result))
|
self.assertEqual(2, len(result))
|
||||||
self.assertEqual(result[0].id, inst2.id)
|
self.assertEqual(result[0].id, inst2.id)
|
||||||
|
self.assertEqual(result[1].id, inst1.id)
|
||||||
|
self.assertTrue(result[1].deleted)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ from nova import test
|
|||||||
from nova import utils
|
from nova import utils
|
||||||
from nova.api.ec2 import cloud
|
from nova.api.ec2 import cloud
|
||||||
from nova.compute import power_state
|
from nova.compute import power_state
|
||||||
|
from nova.compute import vm_states
|
||||||
from nova.virt.libvirt import connection
|
from nova.virt.libvirt import connection
|
||||||
from nova.virt.libvirt import firewall
|
from nova.virt.libvirt import firewall
|
||||||
|
|
||||||
@@ -674,8 +675,9 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
|
|
||||||
# Preparing data
|
# Preparing data
|
||||||
self.compute = utils.import_object(FLAGS.compute_manager)
|
self.compute = utils.import_object(FLAGS.compute_manager)
|
||||||
instance_dict = {'host': 'fake', 'state': power_state.RUNNING,
|
instance_dict = {'host': 'fake',
|
||||||
'state_description': 'running'}
|
'power_state': power_state.RUNNING,
|
||||||
|
'vm_state': vm_states.ACTIVE}
|
||||||
instance_ref = db.instance_create(self.context, self.test_instance)
|
instance_ref = db.instance_create(self.context, self.test_instance)
|
||||||
instance_ref = db.instance_update(self.context, instance_ref['id'],
|
instance_ref = db.instance_update(self.context, instance_ref['id'],
|
||||||
instance_dict)
|
instance_dict)
|
||||||
@@ -713,8 +715,8 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
self.compute.rollback_live_migration)
|
self.compute.rollback_live_migration)
|
||||||
|
|
||||||
instance_ref = db.instance_get(self.context, instance_ref['id'])
|
instance_ref = db.instance_get(self.context, instance_ref['id'])
|
||||||
self.assertTrue(instance_ref['state_description'] == 'running')
|
self.assertTrue(instance_ref['vm_state'] == vm_states.ACTIVE)
|
||||||
self.assertTrue(instance_ref['state'] == power_state.RUNNING)
|
self.assertTrue(instance_ref['power_state'] == power_state.RUNNING)
|
||||||
volume_ref = db.volume_get(self.context, volume_ref['id'])
|
volume_ref = db.volume_get(self.context, volume_ref['id'])
|
||||||
self.assertTrue(volume_ref['status'] == 'in-use')
|
self.assertTrue(volume_ref['status'] == 'in-use')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user