summaryrefslogtreecommitdiff
path: root/heat_integrationtests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-06 11:18:16 +0000
committerGerrit Code Review <review@openstack.org>2015-10-06 11:18:16 +0000
commit6d1273841adf55958e42539749a829c893f34659 (patch)
tree5a8884d69900abc91b9ae6de324f4c257c969006 /heat_integrationtests
parent8f16c9febe99d54b175623b993db22d0c975e5fa (diff)
parent19b8bb1b4caf3a70c90e19f796e34c1b2ddf9a7c (diff)
downloadheat-6d1273841adf55958e42539749a829c893f34659.tar.gz
Merge "Test case for resource_facade"
Diffstat (limited to 'heat_integrationtests')
-rw-r--r--heat_integrationtests/functional/test_template_resource.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py
index 1ec05d993..9609664a4 100644
--- a/heat_integrationtests/functional/test_template_resource.py
+++ b/heat_integrationtests/functional/test_template_resource.py
@@ -245,6 +245,42 @@ outputs:
self.assertEqual(old_way, test_attr2)
+class TemplateResourceFacadeTest(functional_base.FunctionalTestsBase):
+ """Prove that we can use ResourceFacade in a HOT template."""
+
+ main_template = '''
+heat_template_version: 2013-05-23
+resources:
+ the_nested:
+ type: the.yaml
+ metadata:
+ foo: bar
+outputs:
+ value:
+ value: {get_attr: [the_nested, output]}
+'''
+
+ nested_templ = '''
+heat_template_version: 2013-05-23
+resources:
+ test:
+ type: OS::Heat::TestResource
+ properties:
+ value: {"Fn::Select": [foo, {resource_facade: metadata}]}
+outputs:
+ output:
+ value: {get_attr: [test, output]}
+ '''
+
+ def test_metadata(self):
+ stack_identifier = self.stack_create(
+ template=self.main_template,
+ files={'the.yaml': self.nested_templ})
+ stack = self.client.stacks.get(stack_identifier)
+ value = self._stack_output(stack, 'value')
+ self.assertEqual('bar', value)
+
+
class TemplateResourceUpdateTest(functional_base.FunctionalTestsBase):
"""Prove that we can do template resource updates."""