summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorEldar Nugaev <enugaev@griddynamics.com>2010-12-29 23:30:08 +0300
committerEldar Nugaev <enugaev@griddynamics.com>2010-12-29 23:30:08 +0300
commit579d0e1437efb32ef1a1c50ddbfca9093cfa3d18 (patch)
treed2729715fa87b904351ab3ea46eef9428b019b5a /nova/tests
parentd30ec2b5814480010d1b42ce2e9bed9fbc441fd1 (diff)
added tests for EC2 describe_instances
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_cloud.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index d7e99b3c8..3adecb729 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -62,7 +62,7 @@ class CloudTestCase(test.TestCase):
self.cloud = cloud.CloudController()
# set up services
- self.compute = service.Service.create(binary='nova-compute')
+ self.compute = service.Service.create(binary='nova-compute', host='host1')
self.compute.start()
self.network = service.Service.create(binary='nova-network')
self.network.start()
@@ -228,6 +228,20 @@ class CloudTestCase(test.TestCase):
logging.debug("Terminating instance %s" % instance_id)
rv = yield self.compute.terminate_instance(instance_id)
+ def test_describe_instances(self):
+ """Makes sure describe_instances works."""
+ instance1 = db.instance_create(self.context, {'hostname': 'host2'})
+ service1 = db.service_create(self.context, {'host': 'host1',
+ 'availability_zone': 'zone1',
+ 'topic': "compute"})
+ result = self.cloud.describe_instances(self.context)
+ self.assertEqual(result['reservationSet'][0]\
+ ['instancesSet'][0]\
+ ['placement']['availabilityZone'], 'zone1')
+ db.instance_destroy(self.context, instance1['id'])
+ db.service_destroy(self.context, service1['id'])
+
+
def test_instance_update_state(self):
def instance(num):
return {