summaryrefslogtreecommitdiff
path: root/heat_integrationtests
diff options
context:
space:
mode:
authorAngus Salkeld <asalkeld@mirantis.com>2015-09-02 09:10:04 +1000
committerRico Lin <rico.l@inwinstack.com>2015-09-03 02:03:30 +0000
commit19b8bb1b4caf3a70c90e19f796e34c1b2ddf9a7c (patch)
tree1c9e02d53d7e24bdf7719a57e5f08734f7bd7eb4 /heat_integrationtests
parentc79bd02e28e399cd7c1079010954c639b4ae62f2 (diff)
downloadheat-19b8bb1b4caf3a70c90e19f796e34c1b2ddf9a7c.tar.gz
Test case for resource_facade
Change-Id: I8190752a4f415cfc87bf0116b2f2c95905e2685b Related-bug: #1491146
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 a96788835..6ece7d126 100644
--- a/heat_integrationtests/functional/test_template_resource.py
+++ b/heat_integrationtests/functional/test_template_resource.py
@@ -243,6 +243,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."""