summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Tran <jtran@attinteractive.com>2011-08-15 13:48:09 -0700
committerJohn Tran <jtran@attinteractive.com>2011-08-15 13:48:09 -0700
commitf06f80591a41f5d1b373677937bbbcddcfb0bb7c (patch)
treeddecbaecbda66ccd05d7f44fbceb2a7603cdb776
parent066b675e3ce5c2bd67dde124cbe01b68bd1eded8 (diff)
downloadnova-f06f80591a41f5d1b373677937bbbcddcfb0bb7c.tar.gz
nova-f06f80591a41f5d1b373677937bbbcddcfb0bb7c.tar.xz
nova-f06f80591a41f5d1b373677937bbbcddcfb0bb7c.zip
added cloud unit test for describe_instances to ensure doesn't return deleted instances
-rw-r--r--nova/tests/test_cloud.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index b2afc53c9..07a35c447 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -487,6 +487,16 @@ class CloudTestCase(test.TestCase):
db.service_destroy(self.context, comp1['id'])
db.service_destroy(self.context, comp2['id'])
+ def test_describe_instances_deleted(self):
+ args = {'reservation_id': 'a', 'image_ref': 1, 'host': 'host1'}
+ inst1 = db.instance_create(self.context, args)
+ inst2 = db.instance_create(self.context, args)
+ db.instance_destroy(self.context, inst1.id)
+ result = self.cloud.describe_instances(self.context)
+ result = result['reservationSet'][0]['instancesSet']
+ print result
+ self.assertEqual(1, len(result))
+
def _block_device_mapping_create(self, instance_id, mappings):
volumes = []
for bdm in mappings: