diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 95a4884f99..a07af1ae4c 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -128,6 +128,9 @@ # AWS Access Key (string value) #aws_access= +# 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 diff --git a/tempest/config.py b/tempest/config.py index 05a493c786..c2ce698ea6 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -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", diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py index b52d48c449..7616a9926c 100644 --- a/tempest/services/botoclients.py +++ b/tempest/services/botoclients.py @@ -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): diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py index bbfbb797ac..e6a163806c 100644 --- a/tempest/thirdparty/boto/test_ec2_instance_run.py +++ b/tempest/thirdparty/boto/test_ec2_instance_run.py @@ -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 diff --git a/tempest/thirdparty/boto/test_ec2_volumes.py b/tempest/thirdparty/boto/test_ec2_volumes.py index 6a771e5817..12dea18d45 100644 --- a/tempest/thirdparty/boto/test_ec2_volumes.py +++ b/tempest/thirdparty/boto/test_ec2_volumes.py @@ -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):