Split templates and tests in scenario tests
- Added subdirectory "templates" for storing all templates used in
scenario tests.
- Added parameter sub_dir for method _load_template.
- Inline template was moved in templates directory from
test_neutron_autoscaling.
Change-Id: I1acaf1ccc1466cf7ffc2e004eff486f49f4b5928
diff --git a/scenario/test_neutron_autoscaling.py b/scenario/test_neutron_autoscaling.py
index be01328..0e3c404 100644
--- a/scenario/test_neutron_autoscaling.py
+++ b/scenario/test_neutron_autoscaling.py
@@ -12,64 +12,6 @@
from heat_integrationtests.common import test
-test_template = '''
-heat_template_version: 2014-10-16
-
-description: Auto-scaling Test
-
-parameters:
- image_id:
- type: string
- label: Image ID
- description: Image ID from configurations
- capacity:
- type: string
- label: Capacity
- description: Auto-scaling group desired capacity
- fixed_subnet_name:
- type: string
- label: fixed subnetwork ID
- description: subnetwork ID used for autoscaling
- instance_type:
- type: string
- label: instance_type
- description: type of instance to launch
-
-resources:
- test_pool:
- type: OS::Neutron::Pool
- properties:
- description: Test Pool
- lb_method: ROUND_ROBIN
- name: test_pool
- protocol: HTTP
- subnet: { get_param: fixed_subnet_name }
- vip: {
- "description": "Test VIP",
- "protocol_port": 80,
- "name": "test_vip"
- }
- load_balancer:
- type: OS::Neutron::LoadBalancer
- properties:
- protocol_port: 80
- pool_id: { get_resource: test_pool }
- launch_config:
- type: AWS::AutoScaling::LaunchConfiguration
- properties:
- ImageId: { get_param: image_id }
- InstanceType: { get_param: instance_type }
- server_group:
- type: AWS::AutoScaling::AutoScalingGroup
- properties:
- AvailabilityZones : ["nova"]
- LaunchConfigurationName : { get_resource : launch_config }
- MinSize : 1
- MaxSize : 5
- DesiredCapacity: { get_param: capacity }
- LoadBalancerNames : [ { get_resource : load_balancer } ]
-'''
-
class NeutronAutoscalingTest(test.HeatIntegrationTest):
"""
@@ -106,8 +48,11 @@
"fixed_subnet_name": self.conf.fixed_subnet_name,
}}
+ template = self._load_template(__file__,
+ 'test_neutron_autoscaling.yaml',
+ 'templates')
# Create stack
- stack_id = self.stack_create(template=test_template,
+ stack_id = self.stack_create(template=template,
environment=env)
members = self.network_client.list_members()
@@ -116,7 +61,7 @@
# Increase desired capacity and update the stack
env["parameters"]["capacity"] = "2"
self.update_stack(stack_id,
- template=test_template,
+ template=template,
environment=env)
upd_members = self.network_client.list_members()