summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-04 22:29:36 +0000
committerGerrit Code Review <review@openstack.org>2013-01-04 22:29:36 +0000
commit7efe647e365875dfe1fce03d9260c33349f1a75c (patch)
tree8b80a605fbe773180f3c8c9e99acffaae67ddf3f /nova/tests
parent48487f1a4b8f8fa538f90716e293ac8d67853311 (diff)
parent66d0cb1ce5c9d716ad93685ab6e6e86ddbd0b293 (diff)
Merge "Invalid EC2 ids should make the entire request fail."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/ec2/test_cloud.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py
index eef03379f..d73502f43 100644
--- a/nova/tests/api/ec2/test_cloud.py
+++ b/nova/tests/api/ec2/test_cloud.py
@@ -781,11 +781,30 @@ class CloudTestCase(test.TestCase):
self.assertEqual(instance['privateIpAddress'], '192.168.0.3')
self.assertEqual(instance['dnsNameV6'],
'fe80:b33f::a8bb:ccff:fedd:eeff')
+
+ # A filter with even one invalid id should cause an exception to be
+ # raised
+ self.assertRaises(exception.InstanceNotFound,
+ self.cloud.describe_instances, self.context,
+ instance_id=[instance_id, '435679'])
+
db.instance_destroy(self.context, inst1['uuid'])
db.instance_destroy(self.context, inst2['uuid'])
db.service_destroy(self.context, comp1['id'])
db.service_destroy(self.context, comp2['id'])
+ def test_describe_instances_all_invalid(self):
+ """Makes sure describe_instances works and filters results."""
+ self.flags(use_ipv6=True)
+
+ self._stub_instance_get_with_fixed_ips('get_all')
+ self._stub_instance_get_with_fixed_ips('get')
+
+ instance_id = ec2utils.id_to_ec2_inst_id('435679')
+ self.assertRaises(exception.InstanceNotFound,
+ self.cloud.describe_instances, self.context,
+ instance_id=[instance_id])
+
def test_describe_instances_sorting(self):
"""Makes sure describe_instances works and is sorted as expected."""
self.flags(use_ipv6=True)