Don't use hardcoded flavors in tests
Use config values instead. Change-Id: I5755ddc628e08a4336debef4022bebf1542b0200
This commit is contained in:
parent
4078e228dd
commit
549285cd8c
@ -53,7 +53,7 @@ resources:
|
|||||||
|
|
||||||
stack_identifier = self.stack_create(template=self.template,
|
stack_identifier = self.stack_create(template=self.template,
|
||||||
parameters=parameters)
|
parameters=parameters)
|
||||||
parameters['InstanceType'] = 'm1.large'
|
parameters['InstanceType'] = self.conf.instance_type
|
||||||
self.update_stack(stack_identifier, self.template,
|
self.update_stack(stack_identifier, self.template,
|
||||||
parameters=parameters,
|
parameters=parameters,
|
||||||
expected_status='UPDATE_IN_PROGRESS')
|
expected_status='UPDATE_IN_PROGRESS')
|
||||||
|
@ -23,13 +23,16 @@ class ServiceBasedExposureTest(functional_base.FunctionalTestsBase):
|
|||||||
unavailable_service = 'Sahara'
|
unavailable_service = 'Sahara'
|
||||||
unavailable_template = """
|
unavailable_template = """
|
||||||
heat_template_version: 2015-10-15
|
heat_template_version: 2015-10-15
|
||||||
|
parameters:
|
||||||
|
instance_type:
|
||||||
|
type: string
|
||||||
resources:
|
resources:
|
||||||
not_available:
|
not_available:
|
||||||
type: OS::Sahara::NodeGroupTemplate
|
type: OS::Sahara::NodeGroupTemplate
|
||||||
properties:
|
properties:
|
||||||
plugin_name: fake
|
plugin_name: fake
|
||||||
hadoop_version: 0.1
|
hadoop_version: 0.1
|
||||||
flavor: m1.large
|
flavor: {get_param: instance_type}
|
||||||
node_processes: []
|
node_processes: []
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -56,9 +59,11 @@ resources:
|
|||||||
|
|
||||||
def test_unavailable_resources_not_created(self):
|
def test_unavailable_resources_not_created(self):
|
||||||
stack_name = self._stack_rand_name()
|
stack_name = self._stack_rand_name()
|
||||||
|
parameters = {'instance_type': self.conf.minimal_instance_type}
|
||||||
ex = self.assertRaises(exc.HTTPBadRequest,
|
ex = self.assertRaises(exc.HTTPBadRequest,
|
||||||
self.client.stacks.create,
|
self.client.stacks.create,
|
||||||
stack_name=stack_name,
|
stack_name=stack_name,
|
||||||
|
parameters=parameters,
|
||||||
template=self.unavailable_template)
|
template=self.unavailable_template)
|
||||||
self.assertIn('ResourceTypeUnavailable', ex.message)
|
self.assertIn('ResourceTypeUnavailable', ex.message)
|
||||||
self.assertIn('OS::Sahara::NodeGroupTemplate', ex.message)
|
self.assertIn('OS::Sahara::NodeGroupTemplate', ex.message)
|
||||||
|
@ -8,7 +8,6 @@ parameters:
|
|||||||
instance_type:
|
instance_type:
|
||||||
type: string
|
type: string
|
||||||
description: Type of the instance to be created.
|
description: Type of the instance to be created.
|
||||||
default: m1.small
|
|
||||||
|
|
||||||
image_id:
|
image_id:
|
||||||
type: string
|
type: string
|
||||||
|
@ -8,7 +8,6 @@ parameters:
|
|||||||
instance_type:
|
instance_type:
|
||||||
type: string
|
type: string
|
||||||
description: Type of the instance to be created.
|
description: Type of the instance to be created.
|
||||||
default: m1.small
|
|
||||||
|
|
||||||
image_id:
|
image_id:
|
||||||
type: string
|
type: string
|
||||||
|
@ -46,7 +46,7 @@ class VolumeBackupRestoreIntegrationTest(scenario_base.ScenarioTestsBase):
|
|||||||
self.assertEqual(self.volume_description,
|
self.assertEqual(self.volume_description,
|
||||||
self._stack_output(stack, 'display_description'))
|
self._stack_output(stack, 'display_description'))
|
||||||
|
|
||||||
def check_stack(self, stack_id):
|
def check_stack(self, stack_id, parameters):
|
||||||
stack = self.client.stacks.get(stack_id)
|
stack = self.client.stacks.get(stack_id)
|
||||||
|
|
||||||
# Verify with cinder that the volume exists, with matching details
|
# Verify with cinder that the volume exists, with matching details
|
||||||
@ -75,6 +75,7 @@ class VolumeBackupRestoreIntegrationTest(scenario_base.ScenarioTestsBase):
|
|||||||
try:
|
try:
|
||||||
stack_identifier2 = self.launch_stack(
|
stack_identifier2 = self.launch_stack(
|
||||||
template_name='test_volumes_create_from_backup.yaml',
|
template_name='test_volumes_create_from_backup.yaml',
|
||||||
|
parameters=parameters,
|
||||||
add_parameters={'backup_id': backup.id})
|
add_parameters={'backup_id': backup.id})
|
||||||
stack2 = self.client.stacks.get(stack_identifier2)
|
stack2 = self.client.stacks.get(stack_identifier2)
|
||||||
except exceptions.StackBuildErrorException:
|
except exceptions.StackBuildErrorException:
|
||||||
@ -125,4 +126,4 @@ class VolumeBackupRestoreIntegrationTest(scenario_base.ScenarioTestsBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Check stack
|
# Check stack
|
||||||
self.check_stack(stack_id)
|
self.check_stack(stack_id, parameters)
|
||||||
|
Loading…
Reference in New Issue
Block a user