Configure the ec2 zone explicitly

Tempest now creates Availability zones which in parallel run,
may causes issues with EC2 tests.

The EC2 tests will use the preconfigured zone, instead of just picking a
random existing zone.

Closes-Bug: 1265672
Change-Id: I12dfaca868a3f0aec2a85fe45d8a524940d9eae0
This commit is contained in:
Attila Fazekas 2014-02-21 14:49:40 +01:00
parent 50b950155b
commit 27dd92ec10
5 changed files with 8 additions and 15 deletions

View File

@ -128,6 +128,9 @@
# AWS Access Key (string value)
#aws_access=<None>
# AWS Zone for EC2 tests (string value)
#aws_zone=nova
# S3 Materials Path (string value)
#s3_materials_path=/opt/stack/devstack/files/images/s3-materials/cirros-0.3.0

View File

@ -594,6 +594,9 @@ BotoGroup = [
cfg.StrOpt('aws_access',
default=None,
help="AWS Access Key"),
cfg.StrOpt('aws_zone',
default="nova",
help="AWS Zone for EC2 tests"),
cfg.StrOpt('s3_materials_path',
default="/opt/stack/devstack/files/images/"
"s3-materials/cirros-0.3.0",

View File

@ -179,19 +179,6 @@ class APIClientEC2(BotoClientBase):
'revoke_security_group',
'revoke_security_group_egress'))
def get_good_zone(self):
"""
:rtype: BaseString
:return: Returns with the first available zone name
"""
for zone in self.get_all_zones():
# NOTE(afazekas): zone.region_name was None
if (zone.state == "available" and
zone.region.name == self.connection_data["region"].name):
return zone.name
else:
raise IndexError("Don't have a good zone")
class ObjectClientS3(BotoClientBase):

View File

@ -40,7 +40,7 @@ class InstanceRunTest(boto_test.BotoTestCase):
": requires ami/aki/ari manifest")))
cls.s3_client = cls.os.s3_client
cls.ec2_client = cls.os.ec2api_client
cls.zone = cls.ec2_client.get_good_zone()
cls.zone = CONF.boto.aws_zone
cls.materials_path = CONF.boto.s3_materials_path
ami_manifest = CONF.boto.ami_manifest
aki_manifest = CONF.boto.aki_manifest

View File

@ -38,7 +38,7 @@ class EC2VolumesTest(boto_test.BotoTestCase):
raise cls.skipException(skip_msg)
cls.client = cls.os.ec2api_client
cls.zone = cls.client.get_good_zone()
cls.zone = CONF.boto.aws_zone
@test.attr(type='smoke')
def test_create_get_delete(self):