Merge "Allow heat volume tests to use configured volume size"
This commit is contained in:
commit
b713d71c1a
@ -1,10 +1,15 @@
|
||||
heat_template_version: 2013-05-23
|
||||
|
||||
parameters:
|
||||
volume_size:
|
||||
type: number
|
||||
default: 1
|
||||
|
||||
resources:
|
||||
volume:
|
||||
type: OS::Cinder::Volume
|
||||
properties:
|
||||
size: 1
|
||||
size: { get_param: volume_size }
|
||||
description: a descriptive description
|
||||
name: volume_name
|
||||
|
||||
|
@ -1,11 +1,16 @@
|
||||
heat_template_version: 2013-05-23
|
||||
|
||||
parameters:
|
||||
volume_size:
|
||||
type: number
|
||||
default: 1
|
||||
|
||||
resources:
|
||||
volume:
|
||||
deletion_policy: 'Retain'
|
||||
type: OS::Cinder::Volume
|
||||
properties:
|
||||
size: 1
|
||||
size: { get_param: volume_size }
|
||||
description: a descriptive description
|
||||
name: volume_name
|
||||
|
||||
|
@ -32,8 +32,7 @@ class CinderResourcesTest(base.BaseOrchestrationTest):
|
||||
self.assertIsNotNone(volume_id)
|
||||
volume = self.volumes_client.show_volume(volume_id)['volume']
|
||||
self.assertEqual('available', volume.get('status'))
|
||||
self.assertEqual(template['resources']['volume']['properties'][
|
||||
'size'], volume.get('size'))
|
||||
self.assertEqual(CONF.volume.volume_size, volume.get('size'))
|
||||
|
||||
# Some volume properties have been renamed with Cinder v2
|
||||
if CONF.volume_feature_enabled.api_v2:
|
||||
@ -51,8 +50,8 @@ class CinderResourcesTest(base.BaseOrchestrationTest):
|
||||
def _outputs_verify(self, stack_identifier, template):
|
||||
self.assertEqual('available',
|
||||
self.get_stack_output(stack_identifier, 'status'))
|
||||
self.assertEqual(str(template['resources']['volume']['properties'][
|
||||
'size']), self.get_stack_output(stack_identifier, 'size'))
|
||||
self.assertEqual(str(CONF.volume.volume_size),
|
||||
self.get_stack_output(stack_identifier, 'size'))
|
||||
self.assertEqual(template['resources']['volume']['properties'][
|
||||
'description'], self.get_stack_output(stack_identifier,
|
||||
'display_description'))
|
||||
@ -65,7 +64,12 @@ class CinderResourcesTest(base.BaseOrchestrationTest):
|
||||
"""Create and delete a volume via OS::Cinder::Volume."""
|
||||
stack_name = data_utils.rand_name('heat')
|
||||
template = self.read_template('cinder_basic')
|
||||
stack_identifier = self.create_stack(stack_name, template)
|
||||
stack_identifier = self.create_stack(
|
||||
stack_name,
|
||||
template,
|
||||
parameters={
|
||||
'volume_size': CONF.volume.volume_size
|
||||
})
|
||||
self.client.wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE')
|
||||
|
||||
# Verify with cinder that the volume exists, with matching details
|
||||
@ -94,7 +98,12 @@ class CinderResourcesTest(base.BaseOrchestrationTest):
|
||||
"""Ensure the 'Retain' deletion policy is respected."""
|
||||
stack_name = data_utils.rand_name('heat')
|
||||
template = self.read_template('cinder_basic_delete_retain')
|
||||
stack_identifier = self.create_stack(stack_name, template)
|
||||
stack_identifier = self.create_stack(
|
||||
stack_name,
|
||||
template,
|
||||
parameters={
|
||||
'volume_size': CONF.volume.volume_size
|
||||
})
|
||||
self.client.wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE')
|
||||
|
||||
# Verify with cinder that the volume exists, with matching details
|
||||
|
Loading…
x
Reference in New Issue
Block a user