The heat_integrationtests.functional.test_instance_group Module

class heat_integrationtests.functional.test_instance_group.InstanceGroupBasicTest(*args, **kwargs)[source]

Bases: heat_integrationtests.functional.test_instance_group.InstanceGroupTest

test_basic_create_works()[source]

Make sure the working case is good.

Note this combines test_override_aws_ec2_instance into this test as well, which is: If AWS::EC2::Instance is overridden, InstanceGroup will automatically use that overridden resource type.

test_create_instance_error_causes_group_error()[source]

Test create failing a resource in the instance group.

If a resource in an instance group fails to be created, the instance group itself will fail and the broken inner resource will remain.

test_size_updates_work()[source]
test_update_group_replace()[source]

Test case for ensuring non-updatable props case a replacement.

Make sure that during a group update the non-updatable properties cause a replacement.

test_update_instance_error_causes_group_error()[source]

Test update failing a resource in the instance group.

If a resource in an instance group fails to be created during an update, the instance group itself will fail and the broken inner resource will remain.

class heat_integrationtests.functional.test_instance_group.InstanceGroupTest(*args, **kwargs)[source]

Bases: heat_integrationtests.functional.functional_base.FunctionalTestsBase

assert_instance_count(stack, expected_count)[source]
bad_instance_template = '\nheat_template_version: 2013-05-23\nparameters:\n ImageId: {type: string}\n InstanceType: {type: string}\n SecurityGroups: {type: comma_delimited_list}\n UserData: {type: string}\n Tags: {type: comma_delimited_list}\n\nresources:\n random1:\n type: OS::Heat::RandomString\n depends_on: waiter\n ready_poster:\n type: AWS::CloudFormation::WaitConditionHandle\n waiter:\n type: AWS::CloudFormation::WaitCondition\n properties:\n Handle: {Ref: ready_poster}\n Timeout: 1\noutputs:\n PublicIp:\n value: {get_attr: [random1, value]}\n'
instance_template = '\nheat_template_version: 2013-05-23\nparameters:\n ImageId: {type: string}\n InstanceType: {type: string}\n SecurityGroups: {type: comma_delimited_list}\n UserData: {type: string}\n Tags: {type: comma_delimited_list}\n\nresources:\n random1:\n type: OS::Heat::RandomString\n properties:\n salt: {get_param: UserData}\noutputs:\n PublicIp:\n value: {get_attr: [random1, value]}\n'
setUp()[source]
template = '\n{\n "AWSTemplateFormatVersion" : "2010-09-09",\n "Description" : "Template to create multiple instances.",\n "Parameters" : {"size": {"Type": "String", "Default": "1"},\n "AZ": {"Type": "String", "Default": "nova"},\n "image": {"Type": "String"},\n "flavor": {"Type": "String"},\n "user_data": {"Type": "String", "Default": "jsconfig data"}},\n "Resources": {\n "JobServerGroup": {\n "Type": "OS::Heat::InstanceGroup",\n "Properties": {\n "LaunchConfigurationName" : {"Ref": "JobServerConfig"},\n "Size" : {"Ref": "size"},\n "AvailabilityZones" : [{"Ref": "AZ"}]\n }\n },\n\n "JobServerConfig" : {\n "Type" : "AWS::AutoScaling::LaunchConfiguration",\n "Metadata": {"foo": "bar"},\n "Properties": {\n "ImageId" : {"Ref": "image"},\n "InstanceType" : {"Ref": "flavor"},\n "SecurityGroups" : [ "sg-1" ],\n "UserData" : {"Ref": "user_data"}\n }\n }\n },\n "Outputs": {\n "InstanceList": {"Value": {\n "Fn::GetAtt": ["JobServerGroup", "InstanceList"]}},\n "JobServerConfigRef": {"Value": {\n "Ref": "JobServerConfig"}}\n }\n}\n'
class heat_integrationtests.functional.test_instance_group.InstanceGroupUpdatePolicyTest(*args, **kwargs)[source]

Bases: heat_integrationtests.functional.test_instance_group.InstanceGroupTest

ig_tmpl_with_updt_policy()[source]
test_instance_group_update_no_replace()[source]

Test simple update only and no replace with no conflict.

Test simple update only and no replace (i.e. updated instance flavor in Launch Configuration) with no conflict in batch size and minimum instances in service.

test_instance_group_update_no_replace_with_adjusted_capacity()[source]

Test update only and no replace with capacity adjustment.

Test update only and no replace (i.e. updated instance flavor in Launch Configuration) with capacity adjustment due to conflict in batch size and minimum instances in service.

test_instance_group_update_replace()[source]

Test simple update replace with no conflict.

Test simple update replace with no conflict in batch size and minimum instances in service.

test_instance_group_update_replace_huge_batch_size()[source]

Test update replace with a huge batch size.

test_instance_group_update_replace_huge_min_in_service()[source]

Update replace with huge number of minimum instances in service.

test_instance_group_update_replace_with_adjusted_capacity()[source]

Test update replace with capacity adjustment.

Test update replace with capacity adjustment due to conflict in batch size and minimum instances in service.

update_instance_group(updt_template, num_updates_expected_on_updt, num_creates_expected_on_updt, num_deletes_expected_on_updt, update_replace)[source]