Add test to check that can list sizes for all valid EC2 regions
@@ -27,7 +27,7 @@ from libcloud.compute.drivers.ec2 import EC2PlacementGroup
from libcloud.compute.drivers.ec2 import NimbusNodeDriver, EucNodeDriver
from libcloud.compute.drivers.ec2 import OutscaleSASNodeDriver
from libcloud.compute.drivers.ec2 import IdempotentParamError
-from libcloud.compute.drivers.ec2 import REGION_DETAILS
+from libcloud.compute.drivers.ec2 import REGION_DETAILS, VALID_EC2_REGIONS
from libcloud.compute.drivers.ec2 import ExEC2AvailabilityZone
from libcloud.compute.drivers.ec2 import EC2NetworkSubnet
from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation
@@ -71,6 +71,19 @@ class BaseEC2Tests(LibcloudTestCase):
else:
self.fail('Invalid region, but exception was not thrown')
+ def test_list_sizes_valid_regions(self):
+ unsupported_regions = list()
+
+ for region in VALID_EC2_REGIONS:
+ driver = EC2NodeDriver(*EC2_PARAMS, **{'region': region})
+ try:
+ driver.list_sizes()
+ except:
+ unsupported_regions.append(region)
+
+ if unsupported_regions:
+ self.fail('Cannot list sizes from ec2 regions: %s' % unsupported_regions)
+
class EC2Tests(LibcloudTestCase, TestCaseMixin):
image_name = 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml'
